feat: allow to use custom date output formats

closes #116
This commit is contained in:
Danny Koppenhagen
2022-01-10 13:02:31 +01:00
committed by Bastian
parent e0113c446d
commit dc84d19236
9 changed files with 45 additions and 10 deletions

View File

@@ -3,5 +3,5 @@ import moment from "moment";
const isoDateToMoment = (isoDate: moment.MomentInput) =>
moment(isoDate, "YYYY-MM-DD");
export const formatRelease = (isoDate: moment.MomentInput) =>
isoDateToMoment(isoDate).format("MMMM YYYY");
export const formatRelease = (isoDate: moment.MomentInput, format: string = "MMMM YYYY") =>
isoDateToMoment(isoDate).format(format);