Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Update date.js #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rahulsalokhe
Copy link

DD-MMM-YYYY (20-Apr-2020) format not Validated so I changed following code. Please re write if so

var year = date[$.inArray('YYYY', dateFormat)],
month = date[$.inArray('MM', dateFormat)],
monthFul = date[$.inArray('MMM', dateFormat)],
day = date[$.inArray('DD', dateFormat)];

            if (isNaN(month)) {
				var monthArr = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
				month = ($.inArray(monthFul.toLowerCase(), monthArr)+1).toString();
			}

DD-MMM-YYYY (20-Apr-2020) format not  Validated so I changed following code. Please re write if so

 var year  = date[$.inArray('YYYY', dateFormat)],
                month = date[$.inArray('MM', dateFormat)],
                monthFul = date[$.inArray('MMM', dateFormat)],
                day   = date[$.inArray('DD', dateFormat)];
            
                if (isNaN(month)) {
					var monthArr = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
					month = ($.inArray(monthFul.toLowerCase(), monthArr)+1).toString();
				}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant