How to handle dates with different cultures i.e how can i use common javascript code to handle dates for all cultures. For example -
Globalize.culture( "en" );
Globalize.parseDate( "1/2/2003" ); // Thu Jan 02 2003
Globalize.culture( "fr" );
Globalize.parseDate( "1/2/2003" ); // Sat Feb 01 2003
In the above code how i can make generic code instead of changing date format for different cultures.
Thanks in advance
You mean internationalisation. There are standards, such as ISO8601, that specify unambiguous formats such as 2012-02-01 for 1 February, 2012.
I don't think date formats are related to "culture", more to nationality. The vast majority of English speakers in the world use a format of day/month/year, that is related to the country in which they live rather than the any culture they may follow or support.
There are other unambiguous formats, such as always using the month name rather than number, e.g. 01-Feb-2012 or 1 February 2012. The same works for calendars other than Gregorian.