Module

jinks/date

src/jinks/date.pooka

Calendar dates are publication days, not instants wearing an unspecified timezone. Validate the written day before using it in a URL or sort key. Timestamp/timezone support is deliberately a separate future feature.

API reference

class

Date

src/jinks/date.pooka:12
class Date(year: String, month: String, day: String)
field

year

src/jinks/date.pooka:12
year: String
INFERREDString
field

month

src/jinks/date.pooka:12
month: String
INFERREDString
field

day

src/jinks/date.pooka:12
day: String
INFERREDString
constructor

new

src/jinks/date.pooka:12
INFERREDfn(String, String, String) -> jinks/date.Date
function

parse

src/jinks/date.pooka:22
parse(source: String) -> Result(Date, String)
INFERREDfn(String) -> Result(jinks/date.Date, String)
Pooka
assert date.parse("2024-02-29") == Ok(date.Date("2024", "02", "29"))
let assert Error(_) = date.parse("2025-02-29")
function

number

src/jinks/date.pooka:58
number(source: String) -> Result(Int, String)
INFERREDfn(String) -> Result(Int, String)
function

today

src/jinks/date.pooka:65
today() -> String
INFERREDfn() -> String
function

timestamp

src/jinks/date.pooka:75
timestamp() -> String
INFERREDfn() -> String

Capture UTC once for a whole build, including feeds and template functions.

function

rfc822

src/jinks/date.pooka:94
rfc822(source: String) -> Result(String, String)
INFERREDfn(String) -> Result(String, String)

RSS accepts a calendar date with an explicit UTC time; the optional weekday is omitted instead of guessing it from the local machine's timezone.

function

validate_timestamp

src/jinks/date.pooka:118
validate_timestamp(source: String) -> Result(Nil, String)
INFERREDfn(String) -> Result(Nil, String)