Jifty:...ration(3pm)

πŸ“¦
version 0.78 Β· 2 versions
  • 0.78 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.78 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Jifty::DBI::Filter::Duration β€” it encodes time durations, bestie πŸ’– (and yes it decodes them too, we contain multitudes)


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this is a Jifty::DBI filter, which means it sits between your database and your actual Perl values and does the little translation dance so you don't have to. And what does it translate? Durations. Time durations. The whole "3 hours 20 minutes" vibe. It's giving very ✨ temporal ✨ and honestly? Iconic.

It's got two jobs and it does both of them. Let's get into it πŸ’…

🌸 encode 🌸

If the value is defined, then it gets encoded using parse_duration in Time::Duration::Parse. That's it, that's the move. πŸŽ€

If the value is not defined, then... nothing happens. We simply do not engage. No thoughts, head empty, value stays undef. πŸ™ˆ

⚠️ But here's the tea, bestie: if the value can't be parsed, then it gets set to undef. Like, just gone. Unparsable in, undef out. That's the rule, no cap. πŸ’€

🧚 decode 🧚

If the value is defined, then it gets decoded using duration_exact in Time::Duration and concise in Time::Duration. Both of them! Together! A collab. 🀝✨

If the value is not defined, then, once again, nothing happens. We do not lift a finger. We are simply at peace. 😌


πŸ‘‘ SEE ALSO πŸ‘‘

Go be nosy, you deserve it, these are the besties it runs with 🫢

  • Jifty::DBI::Filter β€” the filter parent situation, the whole family
  • Time::Duration β€” where duration_exact and concise live
  • Time::Duration::Parse β€” where parse_duration lives

fr fr, that's the whole page, short and slay. 🌈 This lil doc was written by the User Contributed Perl Documentation crew, running on perl v5.34.0, dated 2022-06-15 β€” so like, vintage but still cute. Mwah. πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from