There are many posts about date formatting, but could not really get what I want from them. many of them are related to getting and formatting current date. Here is my requirement. I need to pull the date field from sample xml ( data binding) which comes in format yyyy-mm-dd and another field comes as yyyy/mm/dd
1. If Locale is "US
Display as mm/dd/yyyy
else if locale is "EUR"
Display as dd/mm/yyyy
2. And I also I need to get the year, month and date for these fields to use them in writing some other logic.
I tried using string built in functions and not happy with it. Is there any date functions to define the date format dynamically for java script, instead of updating them on Formatting option of Date/Time field?