Current application is implemented by JSP, so it will pass localized Date
(in MM/DD/YYYY or DD/MM/YYYY depends on the locale) on the input field entered by user. Then javascript is supposed to identify that date and filter out data (i.e. orders that have been placed) on the UI with the same date.
Just like user enter a date(MM/DD/YYYY or DD/MM/YYYY depends on the locale) then the list of orders on the UI should only remain the ones created on the same date So basically, javascript need to fetch the date entered by user and dates from all orders, to make a compare.
code sample is like this
if(aOrder_date != null ){
if(aOrder_date != '' && aOrder_date != 'undefined'
&& order_date.getTime() != aOrder_date.getTime()){
showUp = false;
}
}
So now the issue is, even JSP(Java) is on Spanish locale, but javascript still take it with English locale. then:
08/03/2013
on the input field is
March, 08, 2013 in Spanish Calendar
but it is interpreted as
Auguest, 03, 2013 in English Calendar
by javascript
Also javascript cannot identify any date after the 12th
(make sense as javascript twist month
and day
) when the page is switched to Spanish
.
So is there anyway to put or sync locale in Javascript then make above working properly?