julian 0.1.2

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

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}');
}

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

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: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

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

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

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

  • 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.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 3 hints.

    Run dartfmt to format lib/julian.dart.

    Run dartfmt to format lib/src/gregorian.dart.

    Similar analysis of the following files failed:

    • lib/src/julian.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.3 <2.0.0
Dev dependencies
test >=0.12.0 <0.13.0