date_calendar 0.1.6

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new50

Dart Calendar

A Calendar interface with a Gregorian Calendar implementation in Dart.

Treats whole days as the smallest unit of time; takes into account leap years.

Not well tested with BC dates (negative dates).

Gregorian implementation does not help you currently with historical dates of when the Gregorian calendar was adapted (e.g. if you want the local date in Denmark before the 1700s, you'll need to switch to Julian, and that's not handled here).

CHANGELOG

0.1.6

  • Bug fix in addDays/addMonths
  • Add unit tests for iterators, addDays

0.1.5

  • Add missing export

0.1.4

  • Make calendar iterators more generic friendly
  • Move claendar iterators to their own file

0.1.3

  • Bugfix for WeekdayMask.fromInteger()

0.1.2

  • Add class to handle weekday masks
  • Fix bad file references in test/example

0.1.1

  • Fix dart analysis issues (remove unused import, fix type issue on compareTo)
  • Throw error if compareTo is called with a non-Gregorian date

0.1.0

  • Initial publication

example/main.dart

import '../lib/date_calendar.dart';
import 'dart:collection';

void main() {
  //  var d = new GregorianCalendar(2018, 14, 31);
  // var d2 = GregorianCalendar.fromInt(1210332);

  var days = GregorianCalendar.getWeekdaysFromWeek(
      new GregorianCalendar(2018, 2, 24), new WeekdayMask.fromIterable([7, 2, 4, 5]));
  print(days);
  // print(d);
  // for (var day in new MonthIterable(
  //   new GregorianCalendar(2018, 1, 31),
  //   new GregorianCalendar(2019, 2, 25),
  //   increment: 1,
  // )) {
  //   print(day);
  // }
}

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  date_calendar: "^0.1.6"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:date_calendar/date_calendar.dart';
        
Version Uploaded Documentation Archive
0.1.6 Feb 17, 2018 Go to the documentation of date_calendar 0.1.6 Download date_calendar 0.1.6 archive
0.1.5 Feb 15, 2018 Go to the documentation of date_calendar 0.1.5 Download date_calendar 0.1.5 archive
0.1.4 Feb 15, 2018 Go to the documentation of date_calendar 0.1.4 Download date_calendar 0.1.4 archive
0.1.3 Feb 12, 2018 Go to the documentation of date_calendar 0.1.3 Download date_calendar 0.1.3 archive
0.1.2 Feb 11, 2018 Go to the documentation of date_calendar 0.1.2 Download date_calendar 0.1.2 archive
0.1.1 Feb 9, 2018 Go to the documentation of date_calendar 0.1.1 Download date_calendar 0.1.1 archive
0.1.0 Feb 9, 2018 Go to the documentation of date_calendar 0.1.0 Download date_calendar 0.1.0 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 17, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
50

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:date_calendar/date_calendar.dart.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

Dependencies

Package Constraint Resolved Available
Dev dependencies
test any