Wijmo Culture is changing date time to date only

Posted by: vinaybietpratap on 17 June 2020, 5:30 am EST

  • Posted 17 June 2020, 5:30 am EST

    Hi,

    I am loading wijmo culture file using cdn in my angluar project. It suppose to convert date time according to loaded culture but it is only showing date.

    ex - new Date(‘2020-01-20 06:07:56’) and culture = ‘de’

    expected output - 20.01.2020 06:07:56 (according to ‘de’ culture)

    acutal output - 15.08.2018

    wijmo culture removing time.

  • Posted 17 June 2020, 5:32 am EST

    acutal output - 20.01.2020 sorry for typo

    wijmo culture removing time.

  • Posted 18 June 2020, 2:29 am EST

    Hi Vinay,

    Can you let us know where the issue actually occurs? Is the date is not formatted in flexgrid or you are explicitly calling the formatDate function to format the date?

    Refer to the demo link below:

    https://www.grapecity.com/wijmo/demos/Core/Globalization/Formatting/purejs

    In the sample, you can observe that you need to parse the date or format the date in the specified format, then only the date will display date and time both.

    In your case, you may use the ‘f’ format:

    var formattedDate = wijmo.Globalize.formatDate(date, 'f');
    

    Regards,

    Ashwin

  • Posted 18 June 2020, 2:43 am EST

    Hi Ashwin,

    I am loading Wijmo culture cdn through the code in my angular project, which is converting numbers and dates automatically in flexgrid, charts(fexchart, flexpie etc…) and pivot everywhere which is my requirement. I am not doing anything specifically , only wijmo culture is converting date and numbers. If I use formatDate() function then I have to manually convert the columns(date, numbers) for every component which I dont want.

    So for numbers and date its doing correct job according to loaded Wijmo culture but for datetime its showing only date which is wrong.

  • Posted 19 June 2020, 4:02 am EST

    Hi,

    Just by adding the culture will not display date and time both. As I said, you need to format it in the specified format. If you are using flexgrid or flexchart, then you need to set the format property of its column or axis respectively.

    flexgrid.columns[0].format = 'f';
    flexchart.axisX.format = 'f';
    

    If this does not resolves the issue or if only setting the de culture is not converting the values, can you please provide a sample replicating the issue so that we can investigate further?

    ~regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels