jQuery UI Widgets Forums React Date Issue -showing one day old date in the UI

This topic contains 5 replies, has 2 voices, and was last updated by  Hristo 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author

  • walker1234
    Participant

    In the source, I’ve date related stuff defined like this:

    const source: any = {
          datafields: [
            
    
            { name: "createdDate", type: "date" },
            
    
          ],

    Similarly, in the columns, I’ve defined it like this:

    const columns: IGridProps["columns"] = [
         
    
          {
            cellsformat: "d",
            datafield: "createdDate",
            text: "Created Date",
            width: 150
          },

    And In the database, let’s say if I’ve CREATED_DATE as 30-OCT-19 as shown below :

    In the widget, it always shows yesterday’s date like this and not today’s date which is what I’m looking for:

    Why is it showing old date?

    I have tried making following changes in the code as shown below:

    const columns: IGridProps["columns"] = [
         
    
          {
            cellsformat: "MM/dd/yyyy",
            datafield: "createdDate",
            text: "Created Date",
            width: 150
          },

    Hristo
    Participant

    Hello walker1234,

    I would like to suggest you use the format member for that particular datafield from the date type.
    Please, try on that way:

    const source: any = {
    	....
    	datafields: [
    		{ name: "createdDate", type: "date", format: "dd-MMM-yy" }
    	],
    	....
    };

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com


    walker1234
    Participant

    You mean, I should only make the change in the source as you suggested and keep the following part as it is?

    const columns: IGridProps["columns"] = [
         
    
          {
            cellsformat: "d",
            datafield: "createdDate",
            text: "Created Date",
            width: 150
          },

    Hristo
    Participant

    Hello walker1234,

    Yes, I meant that.
    I think maybe you tried it already.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com


    walker1234
    Participant

    That didn’t help. I’m still seeing yesterday’s date. Can you tell me how to fix this issue?


    Hristo
    Participant

    Hello walker1234,

    Please, try to use the beforeLoadComplete callback to check what data records you have.
    Is the correct value for the mentioned case used there.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

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

You must be logged in to reply to this topic.