Simple utilities for managing dates and periods.
The Date class simply wraps the DateTime one. But I think it is easier to manage and to understand the logic of the program this way. license.
A simple usage example:
import 'package:vy_date/vy_date.dart';
main() {
Date date = Date.now();
}
Please file feature requests and bugs at the issue tracker.
example/example.dart
// Copyright (c) 2017, Giorgio. 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:vy_date/vy_date.dart';
void main() {
final Date date = Date.now();
final Date nextDay = date.add(Duration(days: 1));
final DatePeriod period = DatePeriod(date, nextDay);
// prints: "Number of days: 2"
print('Number of days: ${period.inDays}');
}
Add this to your package's pubspec.yaml file:
dependencies:
vy_date: ^0.3.2
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.
Now in your Dart code, you can use:
import 'package:vy_date/vy_date.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
0.3.2 | Jan 19, 2019 |
|
|
0.3.1 | Aug 24, 2018 |
|
|
0.3.0 | Jul 21, 2018 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
15
|
Health:
Code health derived from static analysis.
[more]
|
100
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
100
|
Overall:
Weighted score of the above.
[more]
|
57
|
We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, web, other
No platform restriction found in primary library
package:vy_date/vy_date.dart
.