effect icon indicating copy to clipboard operation
effect copied to clipboard

add `Cron.serialize`

Open ghardin1314 opened this issue 6 months ago • 3 comments

Type

  • [ ] Refactor
  • [x] Feature
  • [ ] Bug Fix
  • [ ] Optimization
  • [ ] Documentation Update

Description

Add a Cron.serialize method to convert a Cron instance back into a cron string. It is opinionated as to create the most compact cron string possible.

ghardin1314 avatar Jun 05 '25 16:06 ghardin1314

🦋 Changeset detected

Latest commit: c950aa3fb3353e7c43c9ba3c467cc274b7578566

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
effect Minor
@effect/cli Major
@effect/cluster Major
@effect/experimental Major
@effect/opentelemetry Major
@effect/platform-browser Major
@effect/platform-bun Major
@effect/platform-node-shared Major
@effect/platform-node Major
@effect/platform Major
@effect/printer-ansi Major
@effect/printer Major
@effect/rpc Major
@effect/sql-clickhouse Major
@effect/sql-d1 Major
@effect/sql-drizzle Major
@effect/sql-kysely Major
@effect/sql-libsql Major
@effect/sql-mssql Major
@effect/sql-mysql2 Major
@effect/sql-pg Major
@effect/sql-sqlite-bun Major
@effect/sql-sqlite-do Major
@effect/sql-sqlite-node Major
@effect/sql-sqlite-react-native Major
@effect/sql-sqlite-wasm Major
@effect/sql Major
@effect/typeclass Major
@effect/vitest Major
@effect/workflow Major
@effect/ai Major
@effect/ai-anthropic Major
@effect/ai-openai Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jun 05 '25 16:06 changeset-bot[bot]

Also not sure what to do about time zones :)

tim-smart avatar Jun 05 '25 23:06 tim-smart

Also not sure what to do about time zones :)

Yeah. The time zone needs to be part of it. Probably in the same way as for an ISO date string.

I also wonder whether "includeSeconds" should not be an option but instead be a property on the Cron instance that tracks whether it was created with 5 or 6 segments.

fubhy avatar Jun 06 '25 06:06 fubhy