Skip to content

coke/raku-slang-date

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 4, 2025
481e023 · Feb 4, 2025

History

10 Commits
Feb 4, 2025
Sep 20, 2023
Jan 13, 2023
Feb 4, 2025
Jan 13, 2023
Feb 4, 2025
Jan 13, 2023
Mar 29, 2023

Repository files navigation

Slang::Date

A Slang for Raku that adds support for literal dates in ISO-8601 style.

Examples

Replaces the ISO String with a QAST node that generates a call to Date.new...;

my $a = 2023-01-13;
say "Happy Friday the 13th" if  $a.day-of-week == 5;

Invalid dates will error out as expected:

my $b = 2023-01-99;
Day out of range. Is: 99, should be in 1..31
  in block <unit> at -e line 1

Notes

Requires a 4 digit year, 2 digit month, and 2 digit day.