Skip to content

Commit

Permalink
fix: undefined dates (#11)
Browse files Browse the repository at this point in the history
When a date is undefined (like with the minipools cycle end date when its in prelaunch or launched status), the date is rendered incorrectly (1/1/1970). This fixes it to render 'N/A' instead. https://cln.sh/K4w6Gm1g
  • Loading branch information
Bookcliff authored Apr 20, 2024
1 parent 6e0afd5 commit bd06760
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion public/js/tabulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import { DEPLOYMENT } from "/deployments/selected.js";
// Formatters specific for use in Tabulator cells, try to reuse
// utils.formatters as much as possible
function formatUnixTime(cell, formatterParams, onRendered) {
return formatters.unixToISOOnly(cell.getValue());
const value = cell.getValue();
if (value === undefined || value === null) {
return "N/A";
} else {
return formatters.unixToISOOnly(value);
}
// return formatters.unixToISOOnly(cell.getValue());
}

function formatAmount(cell, formatterParams, onRendered) {
Expand Down

0 comments on commit bd06760

Please sign in to comment.