Search packages, repositories and app categories

Package detailsv2.2.0

week_of_year

Adds extension method to get the ISO 8601 week of year from a date

AndroidiOSWebmacOSWindowsLinux
30-day downloads
25.4K
Likes
47
Pub points
160

Install package

flutter pub add week_of_year

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The week_of_year package extends Dart's DateTime class with an easy-to-use method to calculate the ISO 8601 week of the year. It provides accurate week numbering according to international standards, ensuring consistency across different locales and calendar systems. Ideal for applications requiring weekly scheduling, reporting, or data grouping by week. The package is lightweight, well-documented, and supports all major Flutter platforms.

Use cases

  • Weekly reporting
  • Calendar applications
  • Data aggregation by week
  • Scheduling tools
  • International date compliance

Key features

  • ISO 8601 compliant
  • Simple extension method
  • Cross-platform support
  • Accurate week numbering
  • Minimal dependency

Suitable for

  • Developers needing ISO week numbers
  • Apps with weekly data tracking
  • Internationalized date handling
  • Lightweight date utilities

Considerations

  • Requires Dart 2.12 or higher
  • No additional configuration needed
  • Only adds week-of-year functionality
  • Does not modify original DateTime objects
  • No runtime overhead beyond method call

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

week_of_year

Fast dependency-free extension methods to get the ISO 8601 week of year from a dart DateTime object.

Also includes a function to create a DateTime from a year and week number.

import 'package:week_of_year/week_of_year.dart';

void main() {
  final date = DateTime.now();
  print(date.weekOfYear); // Get the iso week of year
  print(date.ordinalDate); // Get the ordinal date
  print(date.isLeapYear); // Is this a leap year?

  final DateTime dateFromWeekNumber = dateTimeFromWeekNumber(2023, 13, DateTime.tuesday);
  print(dateFromWeekNumber); // 2023-02-28
}

Categories

Source repository

Projects using this package