isoweek
1.1.4, released 4 years ago by jensbecker.dev
Lightweight Dart package providing the Week class based on the ISO 8601 format.
What it does
Provides a Week class to handle ISO 8601 week-numbering years in Dart. Allows you to easily find the current week, navigate to previous or future weeks, retrieve dates within a week, and parse ISO week strings.
AI-written summary of version 1.1.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to work with ISO 8601 week numbers and date ranges in your Dart app.
- You want to calculate previous or future weeks relative to a given date.
Skip it when
- you need a full-featured date/time library with timezone handling and general datetime manipulation.
Strengths
- Simple and lightweight API specifically for ISO 8601 weeks.
- Supports conversions from DateTime and ISO strings.
Weaknesses
- Very narrow scope, limited to week-based operations.
- Does not handle general date formatting or timezones beyond local time.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
import 'package:isoweek/isoweek.dart';
void main() {
Week currentWeek = Week.current();
print('Current week: $currentWeek');
Week futureWeek = currentWeek.addWeeks(5);
print('5 weeks ahead: $futureWeek');
}Alternatives
Packages that do the same job and could replace isoweek.
- country_code
Provides ISO 3166-1 country codes in an enum-like class with parsing and user-assigned elements.
77Compare - iso8601_duration
A package to parse ISO 8601 duration strings.
56Compare - week_of_year
Adds extension methods to get the ISO 8601 week of year from a DateTime object.
50Compare - iso_duration_parser
Parses and formats ISO 8601 duration strings into individual duration parts.
44Compare
Works with
Packages commonly used together with isoweek: ones it builds on, ones built on it, and its own family.