Skip to content

Commit ca8b9a5

Browse files
committed
UPDATE docs
1 parent c9ec6d6 commit ca8b9a5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void main() {
8888

8989
Jalali and Gregorian objects are immutable. So using operators and methods will give you new object and does not manipulate the object in place, like String objects. Almost all other objects in shamsi_date library are immutable too.
9090

91-
You can access `year`, `month`, `day`, `hour`, `minute`, `second` and `millisecond` through getters on Jalali or Gregorian dates. You can get week day number of Jalali and Gregorian by using `weekDay` getter. Week days range from 1 to 7. Jalali week starts with `Shanbe` and Gregorian week starts with `Monday`. Month length can be accessed using `monthLength` getter. Month length is sensitive to leap years. you can check if the year is a leap year by `isLeapYear()` method. Julian day number is also accessible through `julianDayNumber` getter. for example:
91+
You can access `year`, `month`, `day`, `hour`, `minute`, `second` and `millisecond` through getters on Jalali or Gregorian dates. You can get week day number of Jalali and Gregorian by using `weekDay` getter. Week days range from 1 to 7. Jalali week starts with `Shanbe` and Gregorian week starts with `Monday`. Month length can be accessed using `monthLength` getter. Month length is sensitive to leap years. you can check if the year is a leap year by `isLeapYear()` method. Julian day number is also accessible through `julianDayNumber` getter. You can get day of year using `dayOfYear` getter. for example:
9292

9393
```dart
9494
Jalali j = Jalali(1397, 5, 6, 12, 56, 34, 585);
@@ -111,6 +111,8 @@ int ml = j.monthLength; // ml = 31
111111
// note: month and day values are not important for isLeapYear() method
112112
bool ly = j.isLeapYear(); // ly = false (1397 is not leap year)
113113
114+
int doy = j.dayOfYear;
115+
114116
// and equivalently for Gregorian date objects ...
115117
```
116118

@@ -323,7 +325,18 @@ Use toString() of Jalali and Georgian dates only for development purpose, like f
323325
- mNAf: month name in **Afghanistan**. (**ONLY** for `JalaliFormatter`.)
324326
- d: day (whatever length it has).
325327
- dd: two digit day.
328+
- doy: day of year.
329+
- dddoy: three-digit day of year.
326330
- wN: week day name.
331+
- tH: hour.
332+
- tHH: 2-digit hour.
333+
- tM: minute.
334+
- tMM: 2-digit minute.
335+
- tS: seconds.
336+
- tSS: two-digit seconds.
337+
- tMS: milliseconds.
338+
- tMSSS: three-digit milliseconds.
339+
- ds: date seperator. `-` for Gregorian and `/` for Jalali.
327340

328341
You can get date formatter by using `formatter` getter on Jalali and Gregorian date objects. Simply cash this formatter in a Jalali value and then use string interpolation (as we have shown in examples) for making your desired output. This way of formatting is more powerful (and arguably easier) than using templates.
329342

0 commit comments

Comments
 (0)