monthStart

monthStart, function

def const dash pure monthStart(d: date): date

Returns the first day of the month containing d.

Examples

table T = with
  [| as D |]
  [| date(2019, 12, 28) |]
  [| date(2019, 12, 30) |]
  [| date(2020, 1, 1) |]

show table "Month start" with
  T.D
  monthStart(T.D) as "Start"

This produces the following table:

D Start
2019-12-28 2019-12-01
2019-12-30 2019-12-01
2020-01-01 2020-01-01

See also

User Contributed Notes
0 notes + add a note