First page Back Continue Last page Image
- /* This functions takes a cookie date string and reformats is so it
- Can be compared to a system date it requires the id and the
- date from the target cookie */
- function newCheck(grafElement,dtString) {
- // Strip the first 4 characters from the date in decimal and put them in the variable yyyy
- var yyyy = parseInt(dtString.substring(0,4),10);
- // Strip the 5th - 6th characters from the date in decimal and put them in the variable mm
- var mm = parseInt(dtString.substring(4,6),10);
- // Strip the 7th - 8th characters from the date in decimal and put them in the variable dd
- var dd = parseInt(dtString.substring(6,8),10);
- /* create a new variable called lastChgd and use the parts from
- dtString to build it in a format that matches lastVisit */
- var lastChgd = new Date(yyyy,mm-1,dd);
- // If the lastChaged date was after the lastVisit date ...
- if (lastChgd.getTime() > lastVisit.getTime()) {
- // Change the classname of the object to newImg
- grafElement.className += " newImg";
- // The newImg class will result in the new graphic being displayed
- }
- }
- }
dtSrting = 20181102
yyyy = 2018 Decimal
mm = 11 Decimal
dd = 02 Decimal
LastChgd=2018,10,02
Remember the month in most programming languages starts at index 0 (0-11)