Logo Lanfrica

kidusdev/geezdate_dart

Domain:

digital infrastructure

Record type:

software
Creator:
kid
Host:
A simple and minimalisting date utility that helps you work with ethiopian date in dart/flutter. እኛ ራሳችን ለራሳችን ካልሰራን ማን ይሰራልናል። ኣንድ ፈረንጅ መቶ ኣይሰራልን። # GEEZDATE A simple and lightweight date utility designed to make working with Ethiopian dates effortless in Dart and Flutter. It provides an easy-to-use interface, allowing developers to quickly handle and manipulate Ethiopian calendar dates without complexity. Perfect for projects that require seamless integration of Ethiopian date formats ## Installation - using dart ```console $ dart pub add geezdate ``` - using flutter ```console $ flutter pub add geezdate ``` ## Usage ### creating instance of GeezDate ```dart // literal GeezDate final date = GeezDate(2016, 10, 11); // now final date = GeezDate.now(); // from DateTime object final date = GeezDate.fromDateTime(DateTime.now()); // from string must be date-month-year final date = GeezDate.fromString("11-10-2016"); // from json final date = GeezDate.fromJson({"year": 2016, "month": 10, "date": 10}); ``` ### converting ```dart // converting EC to GC final gc = GeezDate(2016, 10, 11).toGC(); // converting GC to EC final ec = GeezDate.fromDateTime(DateTime.now()); // converting through extensions final ec2 = DateTime.now().toEC(); ``` ### operators ```dart final date = GeezDate(2016, 10, 11); final anotherDate = GeezDate(2015, 11, 10); print(date == anotherDate); // false print(date > anotherDate); // true print(date 1 - 30 // .D - day => እሁድ - ቅዳሜ // .m - month index => 1 - 13 // .M - month name => መስከረም - ጳጉሜ // .y - year => 00 // .Y - year => 0000 // .E - calender => ዓ.ም ``` ### adding and subtracting from dates ```dart final date = GeezDate(2016, 3, 11); // adding time final futureDate = date.add(months: 1, days: 10); // subtracting time final pastDate = date.subtract(months: 2, days: 12); // adding through extensions print(date + 3.days); // GeezDate (year: 2016, month: 3, date: 14, hour: 1, minute: 0, second: 0, shift: Shift.day) print(date + 3.days + 2.months); // GeezDate (year: 2016, month: 5, date: 15, hour: 9, minute: …

Languages

Licenses