I need to create a date format in the UK using the date format and language in the USA as "en_GB" in JavaScript. The problem is that my user interface returns the date selected by the user in the format of the current user language, and I want to compare it with another date that comes from an application that always gives me only one format [MM/DD/YY]
Now in JavaScript on the page, I was able to skip these two dates, but since the format is different, the comparison fails.
if(Date.parse(selReqDate) < Date.parse(curDate))
The inputs that I have are:
locale : en_GB uk locale selecteddate : 01/08/2005 [DD/MM/YY] us locale currentdate : 08/01/2005 [MM/DD/YY]
I have the same problem with all locales except US.
source share