dart_date 0.0.8

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

dart_date

Changelog

0.0.8

  • Adding documentation and timeago date.timeago()

example/dart_date_example.dart

import 'package:dart_date/dart_date.dart';

main(List<String> args) {
  const pattern = "'Heute ist' dd-MMMM-yyyy";
  final n = Date.now();
  final d = Date.now().format(pattern, "de_DE");
  final x = Date.parse(pattern, d, locale: "de_DE");
  print("$d ($x)"); // Heute ist 30-November-2018 (2018-11-30 00:00:00.000)

  // ES language is pre-configured;
  print(Date.now().subDays(100).timeago(locale: 'es')); // hace 3 meses
  print(Date.now().format('MMMM dd y, h:mm:ss a')); // November 30 2018, 9:14:29 PM
  print(Date(2006, 6, 6, 6, 6, 6, 6, 6)); // 2006-06-06 06:06:06.006006 // UTC-5
  print(Date(2006, 6, 6, 6, 6, 6, 6, 6).UTC); // 2006-06-06 11:06:06.006006Z // UTC
  var now = Date.now(); // 2018-11-30 21:25:21.092647
  var closest = now.closestTo([ //2018-11-28 21:25:21.025275
    n.nextWeek,
    n.previousDay.previousDay,
    n.previousWeek.nextDay,
    n.nextMonth,
    //n.nextDay,
    //n,
    n.nextYear
  ]);
  print("Closest to now ($now): $closest (${closest.timeago()})");
  // Closest to now (2018-11-30 21:25:21.092647): 2018-11-28 21:25:21.025275 (2 days ago)
}

Use this package as a library

1. Depend on it

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


dependencies:
  dart_date: ^0.0.8

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 flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_date/dart_date.dart';
  
Version Uploaded Documentation Archive
0.0.8 Dec 1, 2018 Go to the documentation of dart_date 0.0.8 Download dart_date 0.0.8 archive
0.0.7 Nov 29, 2018 Go to the documentation of dart_date 0.0.7 Download dart_date 0.0.7 archive
0.0.6 Nov 29, 2018 Go to the documentation of dart_date 0.0.6 Download dart_date 0.0.6 archive
0.0.5 Nov 29, 2018 Go to the documentation of dart_date 0.0.5 Download dart_date 0.0.5 archive
0.0.4 Nov 27, 2018 Go to the documentation of dart_date 0.0.4 Download dart_date 0.0.4 archive
0.0.3 Nov 27, 2018 Go to the documentation of dart_date 0.0.3 Download dart_date 0.0.3 archive
0.0.2 Nov 27, 2018 Go to the documentation of dart_date 0.0.2 Download dart_date 0.0.2 archive
0.0.1 Nov 27, 2018 Go to the documentation of dart_date 0.0.1 Download dart_date 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
27
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]
60
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Format lib/dart_date.dart.

Run dartfmt to format lib/dart_date.dart.

Format lib/src/dart_date.dart.

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

Maintenance suggestions

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

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

The description is too long. (-10 points)

Search engines will display only the first part of the description. Try to keep it under 180 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
intl ^0.15.7 0.15.7
timeago ^2.0.9 2.0.9
Transitive dependencies
path 1.6.2
Dev dependencies
test ^1.3.0