journal-media-vue/src/libs/utils/dates.ts
gcch 0f52ff0cef 2025-02-23
2025-02-24
2025-02-24 00:18:53 +01:00

15 lines
338 B
TypeScript

import { DateTime, pipe } from "effect";
export const getTodayDate = (): string =>
new Date(Date.now()).toLocaleDateString("fr-FR", {
day: "numeric",
month: "long",
weekday: "long",
year: "numeric",
});
export const getCurrentYear = (): number =>
pipe(
DateTime.unsafeNow(),
DateTime.getPart("year"),
);