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
2 parents 1a232b3 + 6bada2b commit 29800d5
Show file tree
Hide file tree
Showing 19 changed files with 15,649 additions and 23 deletions.
Binary file added .DS_Store
Binary file not shown.
74 changes: 74 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
build/

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
10 changes: 10 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
channel: stable

project_type: package
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.

22 changes: 0 additions & 22 deletions LICENSE.md

This file was deleted.

63 changes: 62 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,62 @@
age_calculator
# age_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 29800d5

Please sign in to comment.