Hey Guys
I have a development environment, in which the whole SQL syntax is
stored in the Database.
So the syntax in the databse column could be
"where BirthDate = '12/31/2005' and ID = 345"
Note : The above string is stored and the dates are in US format. so
the dates are displayed in mm/dd/yyyy format, so when the user
retreives this record and shows it in the UI in textbox it would show
what is saved in the Databse - as the above string.
My requirement:-
If User's PC is in British Format (UK English) Locale settings then i
need to parse that string and display that in the UI.
so my expected result should show
"where BirthDate = '31/12/2005' and ID = 345"
Note: UI should show in UK format dd/mm/yyyy
So my idea is to parse the sting using regular expressions for date and
convert then to Client locale setting date format and while sending the
date back (where clause) to the databse then reconvert the string and
save it to the database in the US format.
The same goes for numbering system also. If the User PC is in italian
format then
ID = 345 should show ID = 3,45 (the way Italian format is shown).
I know how to deal with RegEx for password , email validations but not
to an extent of parsing and converting into a desired format.
Any suggestions or help would be really appreciated.
Thanks
Rahul