Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
Issue with date and hour using Chinese regional settings
posted

We are using the XamDateTimeEditor to enter in the start and end dates and times for a reporting module in our application.  For one of our report types, we want to only allow the user to enter the date and the hour range (no minutes).  This works fine for every region setting in Windows except for Chinese and Japanese, as far as I have tested to this point. 

For those two languages, the date shows up as expected, but no hour value is displayed.  There are two spaces for the hour value, and the user can type something in, but the value disappears as soon as the control loses focus.  Everything appears to be correct as far as the DateTime format string is concerned.

The code we use to generate the mask is:

var dateMask = Infragistics.Windows.Editors.XamMaskedEditor.CalcDefaultDateMask(CultureInfo.CurrentCulture);
var timeMask = Infragistics.Windows.Editors.XamMaskedEditor.CalcDefaultTimeMask(CultureInfo.CurrentCulture);
string output = dateMask + " " + timeMask.Replace(":mm""");
return output;

For English, this outputs "mm/dd/yyyy hh tt", and the UI looks like:

For Chinese and Japanese, the output is "yyyy年mm月dd日 hh", and the UI looks like:

Other regions, obviously, have other formats, but, like I said, this only fails for Chinese and Japanese.  We are not seeing this error for other regions that use non-Arabic characters, nor for other regions that use a 24 hour clock.

I can't find anything on our end that would cause this failure, so my next question is if this is a bug on your end.  If so, is there a workaround that we can implement?  Any other thoughts? Thanks in advance.

Parents
No Data
Reply
  • 2490
    Offline posted

    Hello Gordon,

    Thank you for the code you have sent.

    It seems that for some reason the UI images did not pass through. Would you, please try re-uploading them?

    Additionally, can you provide information what version you are currently using.

    Having this information will help me to further investigate this for you.

Children