Catman...d_date(3pm)

πŸ“¦
version 1.2025 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– Catman...d_date(3pm) πŸ’–

okay bestie, so this is Catmandu::Fix::expand_date from the User Contributed Perl Documentation, and we need to have a chat about it. 🫢


🌸 NAME 🌸

Catmandu::Fix::expand_date β€” the fix that takes one lil date field and expands it out into year, month and date. it's giving "deconstructed", it's giving "we spread it out on the table". ✨


πŸ’€ NOTE πŸ’€

THIS PACKAGE IS DEPRECATED AND WILL BE REMOVED IN THE FUTURE. like, not "someday maybe" β€” it's on the chopping block. please use Catmandu::Fix::split_date instead, bestie. i'm begging. πŸ™ˆ

Reasons, in bullet form because we're classy:

  • it writes directly in the root of the hash, which is a different behaviour compared to all the other fixes (sum, count, hash, array ..). not like the other girls, and not in a good way πŸ’€
  • it adds the new keys in a different location, instead of "in place". rude.
  • its behaviour cannot be changed without breaking its current use. so we're stuck with it. tragic. iconic, but tragic.

✨ SYNOPSIS ✨

# {date => "2001-09-11"}
expand_date()
# => {year => 2001, month => "9", day => "11", date => "2001-09-11"}

# {datestamp => "2001:09"}
expand_date(datestamp)
# => {year => 2001, month => "9", datestamp => "2001:09"}

see how it just. does all that. no cap. πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

so the date field gets expanded if it contains a year, optionally followed by numeric month and day, each separated by - or :. that's it, that's the whole vibe check. πŸŽ€


okay that's the whole page, sending u a little mwah, this was perl v5.40.1 dated 2026-01-24, from the User Contributed Perl Documentation, ily, go use split_date πŸ’…πŸ’œ

πŸ“¦ where this page comes from