Fix momentjs deprecation warning
This commit is contained in:
parent
d94843be9f
commit
33a84f682d
@ -3,22 +3,11 @@ import PropTypes from "prop-types";
|
||||
import moment from "moment";
|
||||
|
||||
const prettyDate = (input) => {
|
||||
switch (typeof input) {
|
||||
case "string":
|
||||
if (input === "") {
|
||||
return "";
|
||||
}
|
||||
break;
|
||||
case "number":
|
||||
if (input === 0) {
|
||||
return "";
|
||||
}
|
||||
return input;
|
||||
default:
|
||||
if (typeof input !== "string" || input === "") {
|
||||
return input;
|
||||
}
|
||||
|
||||
const date = moment(input);
|
||||
const date = moment(input, "YYYY-MM-DD HH:mm:ss Z");
|
||||
if (!date.isValid()) {
|
||||
return "";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user