locked
DatePicker values

    Question

  • Hi

    I've created a DatePicker with WinJS and it looks like this: May 08 2012. So there are three Select tags, each for the month, day and year.

    I have a function that contains de date-data (years, months, days, ...) in the language of the user. Is there a way to load this data into the datepicker, so that it gives for example 'May 08 2012' in the US, and 'Mai 08 2012' in France.


    Tuesday, May 08, 2012 1:56 PM

Answers

  • Hi H,

    If you want to override the system behavior, you will need to create your own control to do that.  Realize it should display correctly on a system that is configured for a particula locale so your function is not necessary.

    -Jeff


    Jeff Sanders (MSFT)

    Hi Jeff

    So what you're saying is that one might use my application in the US, and with the WinJS DatePicker he gets the days and months in English, and the other user in perhaps Spain gets the same data but in Spanish? If so, then it depends on the system configuration language or I'm I wrong?

    hssint


    • Edited by hssint Friday, May 11, 2012 8:13 AM
    • Marked as answer by hssint Friday, May 11, 2012 1:33 PM
    Friday, May 11, 2012 7:36 AM

All replies

  • How are you testing the language rendering for the Date Picker control?  Are you on a French system?  I believe it will render for the system set locale.

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, May 09, 2012 3:13 PM
    Moderator
  • How are you testing the language rendering for the Date Picker control?  Are you on a French system?  I believe it will render for the system set locale.

    -Jeff


    Jeff Sanders (MSFT)

    I have a culture function in which the names of the week and months are stored, but I'm not using it, because I don't know how to put these values into the datepicker's values. In other words, replace the datepicker's values by the values of my function.

    • Edited by hssint Thursday, May 10, 2012 9:14 AM
    Thursday, May 10, 2012 9:05 AM
  • Hi H,

    If you want to override the system behavior, you will need to create your own control to do that.  Realize it should display correctly on a system that is configured for a particula locale so your function is not necessary.

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, May 10, 2012 7:08 PM
    Moderator
  • Hi H,

    If you want to override the system behavior, you will need to create your own control to do that.  Realize it should display correctly on a system that is configured for a particula locale so your function is not necessary.

    -Jeff


    Jeff Sanders (MSFT)

    Hi Jeff

    So what you're saying is that one might use my application in the US, and with the WinJS DatePicker he gets the days and months in English, and the other user in perhaps Spain gets the same data but in Spanish? If so, then it depends on the system configuration language or I'm I wrong?

    hssint


    • Edited by hssint Friday, May 11, 2012 8:13 AM
    • Marked as answer by hssint Friday, May 11, 2012 1:33 PM
    Friday, May 11, 2012 7:36 AM
  • You got it! Exactly!

    Jeff Sanders (MSFT)

    Friday, May 11, 2012 12:02 PM
    Moderator