DateTime showing NULL on format

DateTime showing NULL on format

davidjmorindavidjmorin Posts: 101Questions: 31Answers: 0
edited July 2021 in Editor

I have used this many many times in the past. I am not sure if something has changed. I have a table on another server that displays this without issue using the same functions. I believe my other server has a different version of Editor from 2019/2020. This one is whatevr is current at the moment as I just downloaded it and uploaded to new server. The dates will not format.

Where am I going wrong? Table structure is even the same here in this case. Same table name and data.

        Field::inst( 'modified' )
          ->getFormatter(Format::dateTime('Y-m-d H:i:s', 'd-m-Y H:m')),

As you can see the modified response is NULL. There is data in that table.

https://retailtechsupport.com/sku-table/

This question has an accepted answers - jump to answer

Answers

  • davidjmorindavidjmorin Posts: 101Questions: 31Answers: 0

    Here is what I am loading

    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/se-2.2.13/jq-3.3.1/moment-2.18.1/jszip-2.5.0/pdfmake-0.1.36/dt-1.10.25/af-2.3.7/b-1.7.1/b-html5-1.7.1/date-1.1.0/fc-3.3.3/fh-3.1.9/r-2.2.9/sc-2.0.4/sb-1.1.0/sp-1.3.0/sl-1.3.3/datatables.min.css">
    <link rel="stylesheet" type="text/css" href="/Editor/css/generator-base.css">
    <link rel="stylesheet" type="text/css" href="/Editor/css/editor.semanticui.min.css">
    
    <script type="text/javascript" charset="utf-8" src="https://cdn.datatables.net/datetime/1.1.0/js/dataTables.dateTime.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="https://code.jquery.com/jquery-3.5.1.js"></script>
    <script type="text/javascript" charset="utf-8" src="https://cdn.datatables.net/v/se-2.2.13/jq-3.3.1/moment-2.18.1/jszip-2.5.0/pdfmake-0.1.36/dt-1.10.25/af-2.3.7/b-1.7.1/b-html5-1.7.1/date-1.1.0/fc-3.3.3/fh-3.1.9/r-2.2.9/sc-2.0.4/sb-1.1.0/sp-1.3.0/sl-1.3.3/datatables.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Editor/js/dataTables.editor.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Editor/js/editor.semanticui.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Editor/js/table.sku_request.js"></script>
    <script type="text/javascript" charset="utf-8" src="https://cdn.datatables.net/scroller/2.0.4/js/dataTables.scroller.min.js"></script>
    
    
  • davidjmorindavidjmorin Posts: 101Questions: 31Answers: 0

    When I try to do it client side I get the following console errors.

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    From the docs:

    As of Editor v2 this field requires that the DateTime library for DataTables be loaded and available on your page.

    https://editor.datatables.net/reference/field/datetime

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951
    Answer ✓

    When I try to do it client side I get the following console errors.

    Searching for the error, this is one of many threads. Looks like you need ot load this plugin.

    Table structure is even the same here in this case. Same table name and data.

    I'm not familiar with the Datatables provided libraries and formatters but I would start by making sure the datetime format in the database matches what you have in the formatter.

    Kevin

  • davidjmorindavidjmorin Posts: 101Questions: 31Answers: 0

    Thank you @kthorngren That was my issue. Formats.

Sign In or Register to comment.