Hacker News new | ask | show | jobs
by moogly 1355 days ago
Wouldn't this work?

    const firstInMonth = Temporal.Now.with({ day: 1 });
1 comments

Correction:

  Temporal.Now.plainDateISO().with({ day: 1 })
Today (2022-10-10 on my computer), that’ll get you a PlainDate representing 2022-10-01.

The “ISO” in there identifies the calendar. Want to know what the first of the current month in the Hebrew calendar is?

  Temporal.Now.plainDate("hebrew").with({ day: 1 })
And that gives you 2022-09-26[u-ca=hebrew].