Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JErazo7 committed Mar 8, 2021
1 parent 1a232b3 commit 6bada2b
Show file tree
Hide file tree
Showing 16 changed files with 15,565 additions and 1 deletion.
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## [1.0.0] - 08/03/2021

Migration to null safety from package [age](https://pub.dev/packages/age) and added test coverage and new apis

24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Copyright (c) 2021, Josue Erazo
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

63 changes: 62 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,62 @@
age_calculator
# date_calculator

A Flutter package that allows you to perform operations between dates:
- Calculate a person's age and the time remaining to their next birthday in years, months and days.
- Calculate differences between two dates in years, months and days.
- Add years, months and days to any date.

## Getting Started

In your flutter project add the dependency:

dependencies:
...
age_calculator: ^1.0.0

For help getting started with Flutter, view the online documentation.

### Example

```dart
import 'package:age_calculator/age_calculator.dart';
void main() {
DateTime birthday = DateTime(1997, 3, 5);
DateDuration duration;
// Find out your age as of today's date 2021-03-08
duration = AgeCalculator.age(birthday);
print('Your age is $duration'); // Your age is Years: 24, Months: 0, Days: 3
//Find out your age on any given date
duration = AgeCalculator.age(birthday, today: DateTime(2030, 5, 1));
print('Your age is $duration'); // Your age is Years: 33, Months: 1, Days: 26
// Find out when your next birthday will be at 2021-03-08
duration = AgeCalculator.timeToNextBirthday(birthday);
print('You next birthday will be in $duration');
// You next birthday will be in Years: 0, Months: 11, Days: 25
// Find out when your next birthday will be on any given date
duration = AgeCalculator.timeToNextBirthday(birthday,
fromDate: DateTime(2021, 3, 2));
print('You next birthday will be in $duration');
// You next birthday will be in Years: 0, Months: 0, Days: 3
// Find out the difference between two dates
duration = AgeCalculator.dateDifference(
fromDate: DateTime(2021, 1, 2),
toDate: DateTime(2025, 5, 2),
);
print('The difference is $duration');
// You next birthday will be in Years: 4, Months: 4, Days: 0
// Add time to any date
DateTime date = AgeCalculator.add(
date: DateTime(2021, 1, 2),
duration: DateDuration(years: 5, months: 2, days: 1));
print(date);
// 2026-03-03 00:00:00.000
}
```
19 changes: 19 additions & 0 deletions age_calculator.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart Packages" level="project" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
</component>
</module>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"inputs":[],"outputs":[]}
1 change: 1 addition & 0 deletions build/flutter_assets/AssetManifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions build/flutter_assets/FontManifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Loading

0 comments on commit 6bada2b

Please sign in to comment.