jQWidgets Forums

jQuery UI Widgets Forums Grid Date format ignored when pasting

This topic contains 4 replies, has 2 voices, and was last updated by  Hristo 4 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Date format ignored when pasting #112766

    trifas
    Participant

    Hi, I have the following column/datafield pair:

    datafields.push({ name: “DTE_Forecast”, map: “DTE_Forecast”, type: “date”, format: “dd/MM/yyyy” });
    columns.push({ text: “Data”, datafield: “DTE_Forecast”, cellsformat: “dd/MM/yyyy”, editable: true, pinned: true });

    The initial data is displayed correctly.
    If I double click a cell, it enters edit mode, and if I type “19/08/2020” and hit Enter it is displayed correctly too.
    However, if I single click the cell and try to paste this value “19/08/2020”, displays the current date instead.
    If the pasted value is, let’s say, “01/08/2020”, then the cell is updated but displays “08/01/2020” instead.
    It seems that despite the format of the column, it expects the date in “MM/dd/yyyy” format.

    I considered adjusting the input using some event, but when pasting, beginedit and cellvaluechanging doesn’t fire, and by the time cellvaluechanged or updaterow are called, it’s too late to get what the user tried to paste.

    Is there a workaround for this?

    Date format ignored when pasting #112767

    trifas
    Participant

    Here’s a fiddle of the described problem:
    https://jsfiddle.net/g0krz4Lj/1/

    Date format ignored when pasting #112776

    Hristo
    Participant

    Hello trifas,

    Thank you for the feedback.
    I will discuss this with my colleagues.
    As one workaround I think you could try to catch the moment when the user pastes the value and add the value in the edit mode.
    After that, stop the editing.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

    Date format ignored when pasting #112791

    trifas
    Participant

    Thanks for the response!
    Another workaround I found was to set the dateformat to “dd/MMM/yyyy”, with the month as a text, the problem doesn’t happen.
    However, it would be nice for the “dd/MM/yyyy” to be pasteable aswell. I’ll try the suggested workaround and look forward in case there’s built-in way to solve this!

    Date format ignored when pasting #112801

    Hristo
    Participant

    Hello trifas,

    Thank you for these details.
    You could check the progress for this issue on this page.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.