dart_calendar 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 62

calendar.dart #

Port for Python's calendar.py to Dart

Installation #

Add dependancies #

dependencies:
  dart_calendar: 0.0.x  #latest version 

Then #

pub get

Usage #

import 'package:calendar/calendar.dart';


void main() {
  // Sunday first calendar 
  final calendar = new Calendar(
    weekStartDay: 7 // Sunday as start of week
  );
  
  // Monday First Calendar
  final mondayFirstCalendar = new Calendar(
    weekStartDay: 1
  );
  
  // Calendar Month
  // Calendar for January, 2019
  print(calendar.monthDatesCalendar(2019, 1));
  
  // Calendar Year
  // Calendar for Year 1
  print(calendar.yearDatesCalendar(1));
  
  


  // Custom Calendar ranging from given start and end dates
  final now = DateTime.now();
  final future = now.add(Duration(days: 75));
  
  print(calendar.customDatesCalendar(now, future));
}


Inspired by #

calendar.js https://github.com/ramalho/calendar.js/

Change log #

example/main.dart

import 'package:dart_calendar/dart_calendar.dart';


void main() {
  // Sunday first calendar 
  final calendar = new Calendar(
    weekStartDay: 7 // Sunday as start of week
  );
  
  // Monday First Calendar
  final mondayFirstCalendar = new Calendar(
    weekStartDay: 1
  );
  
  // Calendar Month
  // Calendar for January, 2019
  print(calendar.monthDatesCalendar(2019, 1));
  
  // Calendar Year
  // Calendar for Year 1
  print(calendar.yearDatesCalendar(1));
  
  


  // Custom Calendar ranging from given start and end dates
  final now = DateTime.now();
  final future = now.add(Duration(days: 75));
  
  print(calendar.customDatesCalendar(now, future));
}

Use this package as a library

1. Depend on it

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


dependencies:
  dart_calendar: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:dart_calendar/dart_calendar.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
33
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Oct 7, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Format lib/dart_calendar.dart.

Run dartfmt to format lib/dart_calendar.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0