From e8ff6ff590f1256a3ce83ce96a0c43e47164af17 Mon Sep 17 00:00:00 2001 From: Brazesh Tamang Date: Wed, 13 Jul 2022 16:03:43 +0545 Subject: [PATCH] Create README.md --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..4f37410 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# nepdate +A Java 8 Nepali date converter library + +Available on maven central + +Using gradle +```gradle +implementation 'io.github.aagitoex:nepdate:0.0.1-alpha02' +``` + +OR + +Maven +```xml + + io.github.aagitoex + nepdate + 0.0.1-alpha02 + +``` + +Use cases +### Conversion +```java +//from AD to BS +NepDate nepDate = fromADToBS(LocalDate.now()); +int year = nepDate.getYear(); +int month = nepDate.getMonth(); +int day = nepDate.getDay(); + +//from BS to AD +LocalDate date = fromBSToAD(NepDate.now()); +``` + +### Working with `NepDate` only +```java +//static helpers +NepDate nepDate = NepDate.now(); +NepDate nepDate = NepDate.MAX; +NepDate nepDate = NepDate.MIN; +int daysInMonth = NepDate.getDaysInMonth(year, month); +int daysInYear = NepDate.getDaysInYear(year); + +//addition and subtraction +nepDate.plusDays(10); //addition +nepDate.plusDays(-5); //subtraction +nepDate.plusMonths(34); +nepDate.plusYears(10); + +//count days +nepDate.daysBetween(NepDate.now()); + +//get AD equivalent +LocalDate date = nepDate.getAD(); + +//supports comparision through java's `Comparable<>` interface +Arrays.sort(nepDateArray); +``` + +Documentation work in progress