julian 0.1.2

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

julian

Obtain the Julian day number from a proleptic Julian or Gregorian calendar day and conversely obtain a proleptic Julian or Gregorian calendar day from a Julian day number.

Usage

A simple usage example:

import 'package:julian/julian.dart';

main() {
  // On what Gregorian date is the Julian day number equal to zero?
  // prints Gregorian(year: -4713, month: 11, day: 24)
  print('${new Gregorian.fromJulianDayNumber(0)}');

  // What was the Julian day number at the turn of the Millennium?
  // prints 2451545
  print('${new Gregorian(2000, 1, 1).julianDayNumber}');

  // On which Gregorian day of July should we celebrate Julius Caesar's
  // birthday?
  // prints 11
  print('${new Julian.fromBC(100, 7, 13).toGregorian().day}');

  // By how many days is the Julian calendar ahead of the Gregorian calendar
  // in 2016?
  // prints 13
  print('${new Julian(2016, 1, 1).julianDayNumber -
      new Gregorian(2016, 1, 1).julianDayNumber}');
}

Background reading

Related calendrical Wikipedia articles:

Changelog

0.1.1

  • Minor stylistic adjustments to the docs.
  • Corrected a mistake in the example comments.

0.1.0

  • Added a bool time dependency flag considerTimeOfDay to Gregorian.fromDateTime constructor.
  • Updated docs.
  • Simplified Gregorian/Julian toString output.

0.0.2

  • Updated the README with an astronomical year numbering hyperlink.
  • Changed some comments to match the correct dartlang style.

0.0.1

  • Initial version

example/julian_example.dart

// Copyright (c) 2016, Christian Stewart. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.

import 'package:julian/julian.dart';

main() {
  // On what Gregorian date is the Julian day number equal to zero?
  // prints Gregorian(year: -4713, month: 11, day: 24)
  print('${new Gregorian.fromJulianDayNumber(0)}');

  // What was the Julian day number at the turn of the Millennium?
  // prints 2451545
  print('${new Gregorian(2000, 1, 1).julianDayNumber}');

  // On which Gregorian day of July should we celebrate Julius Caesar's
  // birthday?
  // prints 11
  print('${new Julian.fromBC(100, 7, 13).toGregorian().day}');

  // By how many days is the Julian calendar ahead of the Gregorian calendar
  // in 2016?
  // prints 13
  print('${new Julian(2016, 1, 1).julianDayNumber -
      new Gregorian(2016, 1, 1).julianDayNumber}');
}

Use this package as a library

1. Depend on it

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


dependencies:
  julian: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:julian/julian.dart';
  
Version Uploaded Documentation Archive
0.1.2 Mar 24, 2017 Go to the documentation of julian 0.1.2 Download julian 0.1.2 archive
0.1.1 Oct 29, 2016 Go to the documentation of julian 0.1.1 Download julian 0.1.1 archive
0.1.0 May 10, 2016 Go to the documentation of julian 0.1.0 Download julian 0.1.0 archive
0.0.2 Apr 30, 2016 Go to the documentation of julian 0.0.2 Download julian 0.0.2 archive
0.0.1 Apr 30, 2016 Go to the documentation of julian 0.0.1 Download julian 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
47
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
24
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

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