fix: Chrome-n hilabetea ongi margotzen du
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import type { ImageMedia } from "./ImageMedia";
|
import type { ImageMedia } from "./ImageMedia";
|
||||||
import type { Zikloa } from "./Zikloa";
|
import type { Zikloa } from "./Zikloa";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import "dayjs/locale/eu";
|
||||||
|
|
||||||
export interface Ekintza {
|
export interface Ekintza {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -24,10 +26,7 @@ export type EkintzaSnippet = Pick<
|
|||||||
|
|
||||||
export function getShortDate(ekintza: Pick<Ekintza, "hitzordua">): string {
|
export function getShortDate(ekintza: Pick<Ekintza, "hitzordua">): string {
|
||||||
const date = new Date(ekintza.hitzordua);
|
const date = new Date(ekintza.hitzordua);
|
||||||
const day = date.getDate();
|
return dayjs(date).locale("eu").format("MMM D");
|
||||||
const month = date.toLocaleString("eu", { month: "short" });
|
|
||||||
|
|
||||||
return `${month} ${day}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUrl(ekintza: Pick<Ekintza, "slug">): string {
|
export function getUrl(ekintza: Pick<Ekintza, "slug">): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user