{"id":50778394,"url":"https://github.com/meragix/calx","last_synced_at":"2026-06-12T01:30:43.546Z","repository":{"id":363459835,"uuid":"1263396548","full_name":"meragix/calx","owner":"meragix","description":"⏱️ A lightweight, immutable, and fully tree-shakeable date manipulation library for Dart \u0026 Flutter. Functional-first core with zero-allocation opt-in extensions.","archived":false,"fork":false,"pushed_at":"2026-06-09T01:32:17.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T03:14:44.176Z","etag":null,"topics":["dart","date-fns","date-manipulation","flutter","functional-programming","immutable","performance","tree-shaking"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meragix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-08T23:17:27.000Z","updated_at":"2026-06-09T01:32:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/meragix/calx","commit_stats":null,"previous_names":["meragix/calx"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/meragix/calx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meragix%2Fcalx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meragix%2Fcalx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meragix%2Fcalx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meragix%2Fcalx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meragix","download_url":"https://codeload.github.com/meragix/calx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meragix%2Fcalx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34225350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","date-fns","date-manipulation","flutter","functional-programming","immutable","performance","tree-shaking"],"created_at":"2026-06-12T01:30:41.980Z","updated_at":"2026-06-12T01:30:43.511Z","avatar_url":"https://github.com/meragix.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to Calx\n\nA functional, tree-shakeable date utility library for Dart, proudly inspired by [date-fns](https://date-fns.org).\n\nCalx works directly on your native `DateTime` objects. That means **zero wrapper overhead** and absolutely **zero dependencies**. It’s just clean, reliable date manipulation.\n\n## Why choose Calx?\n\nIf you've ever wrestled with Daylight Saving Time (DST) or bulky date wrappers, Calx is here to help. Here is how we stack up:\n\n| Feature | `DateTime` SDK | `jiffy` | `calx` |\n|---|---|---|---|\n| **Paradigm** | Imperative | OO Wrapper | **Pure functional** |\n| **Tree-shaking** | Native | ❌ Monolith | ✅ **Per function** |\n| **Dependencies** | None | Yes | ✅ **Zero** |\n| **DST-safe** | ❌ Tricky | Partial | ✅ **Tested invariants** |\n| **Immutability** | ✅ | ❌ | ✅ |\n\n## Installation\n\nGetting started is simple. Just add Calx to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  calx: ^0.1.0\n```\n\n## How to Use It\n\nYou can use Calx in two ways, depending on your coding style:\n\n### 1. Pure functions (Main API)\nFor fans of functional programming, use the core functions directly.\n\n```dart\nimport 'package:calx/calx.dart';\n\n// Manipulation\nfinal nextMonth  = addMonths(DateTime.now(), 1);\nfinal nextWeek   = addDays(DateTime.now(), 7);\nfinal nextYear   = addYears(DateTime.now(), 1);\nfinal weekStart  = startOfWeek(DateTime.now());\n\n// Comparison\nfinal isOverdue  = isBeforeDay(dueDate, DateTime.now());\nfinal sameDay    = isSameDay(dateA, dateB);\nfinal sameMonth  = isSameMonth(dateA, dateB);\nfinal inRange    = isWithinInterval(date, start: from, end: to);\n\n// Query\nfinal leapYear   = isLeapYear(DateTime.now());\nfinal today      = isToday(date);\nfinal days       = daysInMonth(DateTime.now());\nfinal diff       = differenceInDays(dateA, dateB);\n```\n\n### 2. Opt-in extensions (Fluent API)\nIf you prefer method chaining, you can easily opt-in to our extension methods.\n\n```dart\nimport 'package:calx/calx_extensions.dart';\n\nfinal next  = DateTime.now().addMonths(1);\nfinal start = DateTime.now().startOfWeek();\nfinal same  = dateA.isSameDay(dateB);\nfinal leap  = DateTime(2024).isLeapYear;\n```\n\n## Our Core Principles\n\nCalx is built around four fundamental principles to guarantee predictable and safe date math:\n\n- **UTC/Local preservation:** every function returns a `DateTime` with the exact same `isUtc` flag as its input. We never convert types unexpectedly.\n- **Civil time arithmetic:** `addDays(date, 1)` always returns the next calendar day, regardless of Daylight Saving Time (DST) shifts. \n- **Strict immutability:** no function ever modifies the input date you pass in.\n- **Mixed representation guard:** comparing a UTC `DateTime` with a local `DateTime` is usually a bug waiting to happen, so Calx throws an `AssertionError` in debug mode to help you catch it early!\n\nWant to know more?  \nCheck out our [Architecture \u0026 Design Decisions](doc/architecture.md) and learn more about [how we handle Daylight Saving Time](doc/dst_handling.md).\n\n## Compatibility\n\n- Dart SDK `\u003e=3.0.0 \u003c4.0.0`\n- Flutter ✅, works beautifully on mobile, web, and desktop!\n\n## Contributing\n\nWe'd love your help to make Calx even better! If you're interested in contributing, please check out our [Contributing Guidelines](CONTRIBUTING.md) to get started.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeragix%2Fcalx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeragix%2Fcalx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeragix%2Fcalx/lists"}