week_number
1.1.1, released 2 years ago by sousyokunotomonokai.com
Extension methods to get the week number and ordinal date from a DateTime object.
What it does
Adds fast, dependency-free extension methods to Dart's DateTime object to compute ISO 8601 or Western Traditional week numbers. It also provides functions to create DateTime objects from year and week numbers or ordinal dates.
AI-written summary of version 1.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to calculate ISO 8601 or Western Traditional week numbers from DateTime objects.
- You want to convert ordinal dates or week numbers back into DateTime instances.
Skip it when
- You need heavy internationalization or full calendar localization beyond standard week systems.
Strengths
- Dependency-free
- Supports both ISO 8601 and Western Traditional systems
- Includes helper functions for ordinal dates and leap years
Weaknesses
- Very narrow scope focused only on week numbers and ordinal dates
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:week_number/iso.dart';
void main() {
final date = DateTime.now();
print(date.weekNumber);
print(date.ordinalDate);
print(date.isLeapYear);
}Alternatives
Packages that do the same job and could replace week_number.
- week_of_year
Adds extension methods to get the ISO 8601 week of year from a DateTime object.
50Compare - awesome_extensions
A comprehensive collection of Dart and Flutter extensions to reduce boilerplate code.
82Compare - mime
Utilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
92Compare - fast_immutable_collections
Fast immutable lists, sets, maps, and multimaps for Dart
91Compare