Manual processing of month can be processed using Typst standard library
jamesrswift opened this issue · 2 comments
jamesrswift commented
Lines 1 to 27 in dfc0345
This can be achieved like so:
#let monthname(n, display: "short") = {
datetime(month: n, day: 1, year: 0).display("[month repr:#display]")
}
This will throw on an invalid month so if that isn't desirable you should add another line to check if n is within the range 1 to 12.
jskherman commented
Yes, the datetime.display()
function was used before for formatting but as pointed out in PR #22, Typst still only has English month names as the output. The current state is only a band-aid solution until Typst has proper support for other languages in datetime.display()
.
jskherman commented
Closing this since there is no more input, probably.