Spread V11: Dates are not working properly in Spanish culture

Posted by: viswanath.malepati on 3 July 2018, 8:12 pm EST

    • Post Options:
    • Link

    Posted 3 July 2018, 8:12 pm EST

    Hi,

    In Spread V11, when we are trying to set dates for a cell which has culture specific cell format is not working in especially spanish culture.

    Steps to reproduce:

    1. Please find the attachment and extract them
    2. Each file is set to a specific culture (German, French and Spanish)
    3. Run each of them and check the console for the output. Note that in spanish (es), the output is different and not culture specific.

    What I am doing in each of these files is same code, which is as below:

    c = sheet.getCell(0,0);

    c.formatter(“dd/MM/yyyy”);

    c.value(“12/1/2018”); //setting date in en-us date format 1st December 2018

    console.log(c.text());

    // in spanish alone we will see 12/1/2018, which mean 12th jan 2018

    date-culture-issue.zip

    Thanks,

    Viswanath

  • Posted 3 July 2018, 10:12 pm EST

    Hello,

    We are able to replicate the issue and hence we are escalating the same to the concerned team for the fix.

    We will update you as soon as we hear anything from our concerned team.

    Tracking id for your issue is #260333

    Thanks,

    Reeva

  • Posted 9 July 2018, 10:35 pm EST

    Hello,

    Our developers have confirmed that this isn’t a bug. The cell’s value specified the real cell data.

    If you want to set a date to the cell, the first thing is that providing a real date type instance to cell’s value.

    The whole formatter system is working on below:

    object (string,number,date,boolean…) → formatter.format method → string (display in cell)

    string → formatter.parse method → object (string,number,date, boolean, save in cell’s value)

    Hence, you may see that in your case you want to use a string then format to another string, but the use case handled as a date type, that is incorrect.

    Change the code to below will make all things clear:-

    c = sheet.getCell(0,0);
    c.formatter("dd/MM/yyyy");
    c.value(new Date(2018,0,12));
    console.log(c.text());
    

    Hope it helps.

    Thanks,

    Reeva

Need extra support?

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

Learn More

Forum Channels