GetAsLocalizedDate, GetAsLocalizedDateTime do not work correctly
#1
The GetAsLocalizedDate and GetAsLocalizedDateTime do not respect the values in langinfo.xml.

This is how they work now:
Code:
GetAsLocalaizedDate(); //short date - Overrides DDD in langinfo.xml with ddd
bool longDate = false;
bool withShortNames = false;
GetAsLocalizedDate(longDate,withShortNames); // short date exactly as specified in langinfo.xml
In order to get what should be default behavior, you have to explicitly pass in two arguments.

Code:
bool longdate = true;
GetAsLocalizedDate(longDate);long date - Overrides DDD in langinfo.xml with dddl
bool longDate = true;
bool withShortNames = false;
GetAsLocalizedDate(longDate,withShortNames); // longDate date exactly as specified in langinfo.xml
Again, in order to get what should be default behavior, you have to explicitly pass in an extra argument.

Code:
GetAsLocalizedDateTime(); //short date with time - Overrides DDD in langinfo.xml with ddd
bool longDate = true;
GetAsLocalizedDateTime(longDate);//long date with time - Overrides DDD in langinfo.xml with ddd
There is no way to call GetAsLocalizedDateTime that will return the date exactly as specified in langinfo.xml.

Here is how I think they should work:
Code:
GetAsLocalizedDate(); // Short date exactly as specified in langinfo,xnl
bool longDate = true;
GetAsLocalizedDate(longDate); // long date exactly as specified in langinfo.xml
bool longDate = false;
bool withShortNames=true;
GetAsLocalizedDate(longDate,withShortNames); // short date -Overrides DDD in langinfo.xml with ddd
bool longDate = true;
bool withShortNames=true;
GetAsLocalizedDate(longDate,withShortNames); // long date - Overrides DDD in langinfo.xml with dddl

GetAsLocalizedDateTime(); // short date with time, exactly as specified in langinfo.xml
bool longDate = true;
GetAsLocalizedDateTime(longDate); // long date with time exactly as specified in langinfo.xml
bool longDate = false;
bool withSeconds = false;
GetAsLocalizedDateTime(longDate,withSeconds); // short date with time, date exactly as specified in langinfo.xml, time does not contain seconds
bool longDate = false;
bool withSeconds = false;
bool withShortNames = true;
GetAsLocalizedDateTime(longDate,withSeconds,withShortNames); // short date with time, date overrides DDD in langinfo.xml with ddd , time does not contain seconds
bool longDate = true;
bool withSeconds = false;
GetAsLocalizedDateTime(longDate,withSeconds); // long date with time, date exactly as specified in langinfo.xml, time does not contain seconds
bool longDate = true;
bool withSeconds = false;
bool withShortNames = true;
GetAsLocalizedDateTime(longDate,withSeconds,withShortNames); // long date with time, date overrides DDD in langinfo.xml with ddd , time does not contain seconds
bool longDate = false;
bool withSeconds = true;
bool withShortNames = true;
GetAsLocalizedDateTime(longDate,withSeconds,withShortNames); // short date with time, date overrides DDD in langinfo.xml with ddd , time as specified in langinfo.xml
bool longDate = true;
bool withSeconds = true;
bool withShortNames = true;
GetAsLocalizedDateTime(longDate,withSeconds,withShortNames); // long date with time, date overrides DDD in langinfo.xml with ddd , time as specified in langinfo.xml
This makes more sense. You will get the date and time formatted exactly as the user wants (as specified in langinfo.xml), unless you explicitly code some other behavior. The way it works now, unless you go out of your way, you will always override what the user has asked for in langinfo.xml.
If there are no objections, I will change the code to respect langinfo.xml by default.
Reply

Logout Mark Read Team Forum Stats Members Help
GetAsLocalizedDate, GetAsLocalizedDateTime do not work correctly0