feat: clean up filters
Some sorely needed reorganization and pruning
This commit is contained in:
parent
e6cfa88f61
commit
ea6280226a
11 changed files with 159 additions and 176 deletions
14
config/filters/date.js
Normal file
14
config/filters/date.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
import dayjs from "dayjs";
|
||||
import utc from "dayjs/plugin/utc.js";
|
||||
import advancedFormat from "dayjs/plugin/advancedFormat.js";
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(advancedFormat);
|
||||
|
||||
const formatDate = (date, format) => dayjs.utc(date).format(format);
|
||||
const formatAsUTCString = (date) => new Date(date).toUTCString();
|
||||
|
||||
export default {
|
||||
formatDate,
|
||||
formatAsUTCString,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue