2

I'm trying to sort a FooTable table on a date column which also has null values, outputted as empty strings. I have included moment.js before footable and footable.sorting in my HTML. My null values are displayed and sorted as 01.01.1970. There are no js console errors. Anyone able to point me in the right direction as to how to fix this?

<table class="footable table table-striped" data-sorting="true">
    <thead>
    <tr>
        <th>(...)</th>
        <th data-type="date" data-format-string="DD.MM.YYYY">Invoice Date</th>
        <th>(...)</th>
    </tr>
    </thead>
sjur
  • 53
  • 1
  • 4
  • I am having the same issue, but it is showing December 31, 1969 for blank dates. -- FooTable v3.1.5 – barrypicker Aug 02 '17 at 18:10
  • I'm at UTC. Your problem sounds like the same issue only on a different time zone? I have FooTable 3.1.6 and Moment.js 2.18.1 – sjur Aug 03 '17 at 06:43
  • I ended up not specifying the datatype as date and consider it a string. Added datetime ticks for data-sort-value, and formatted string for data-filter-value. I did not rely on the footable data-format-string as the datatype date was removed. – barrypicker Aug 03 '17 at 16:54
  • @sjur did you try formatter, the example i provided. this is all for formating parts. – Qaiser Mehmood Aug 21 '17 at 13:04
  • Thanks, I ended up doing what @barrypicker did, treating it as string and sorting by ticks. – sjur Aug 23 '17 at 07:19

1 Answers1

0

https://fooplugins.github.io/FooTable/docs/getting-started.html#column-formatter

Use column formatter and put custom checks of Null. All will work ok.

Qaiser Mehmood
  • 202
  • 2
  • 10