@kahi-ui/framework
Version:
Straight-forward Svelte UI for the Web
16 lines (15 loc) • 557 B
JavaScript
import { Temporal } from "../../vendor/js-temporal-polyfill";
export function from_datestamp(timestamp, modify) {
return modify
? Temporal.PlainDate.from(timestamp).withCalendar("iso8601").with(modify)
: Temporal.PlainDate.from(timestamp).withCalendar("iso8601");
}
export function to_datestamp(date, modify) {
return modify
? date.withCalendar("iso8601").with(modify).toString({
calendarName: "never",
})
: date.withCalendar("iso8601").toString({
calendarName: "never",
});
}