Public
Edited
Jan 6, 2023
Insert cell
Insert cell
Temporal = require("proposal-temporal")
Insert cell
str = "2020-01-04 17:36:06 -0500"
Insert cell
d = new Date(str)
Insert cell
Temporal.Temporal.Instant.from(str)
Insert cell
Insert cell
dayjs = {
const t = await require("dayjs");
const utc = await require("dayjs/plugin/utc");
const weekOfYear = await require("dayjs/plugin/weekOfYear");
const weekYear = await require("dayjs/plugin/weekYear"); // dependent on weekOfYear plugin
return t.extend(utc).extend(weekOfYear).extend(weekYear);
}
Insert cell
dayjs(str)
Insert cell
[
dayjs("2021-12-31").weekYear(),
dayjs("2021-12-31").week(),
dayjs("2021-12-31").day()
]
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more