Skip to content

Commit

Permalink
📝 doc: update readme and test script
Browse files Browse the repository at this point in the history
  • Loading branch information
anuzpandey committed Nov 18, 2023
1 parent 1511b9c commit 6d4a9e2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ LaravelNepaliDate::from($engDate)->toNepaliDate();
LaravelNepaliDate::from($engDate)->toNepaliDate(format: 'D, j F Y');
// Result: सोम, १० वैशाख २०५३

// Format Specifiers are supported and listed below
LaravelNepaliDate::from($engDate)->toNepaliDate(format: 'D, j F Y', locale: 'en');
// Result: Mon, 10 Baisakh 2053

Expand All @@ -49,6 +50,21 @@ LaravelNepaliDate::from($engDate)->toNepaliDateArray()->toArray();
LaravelNepaliDate::from($engDate)->toEnglishDateArray()->toArray();
```

## Format Specifiers

The following format specifiers are supported for formatting dates:
- `Y` - Year in four digits
- `y` - Year in two digits
- `m` - Month in two digits with leading zero (01-12/०१-१२)
- `n` - Month in one or two digits without leading zero (1-12/१-१२)
- `M` - Month in three letters (Jan-Dec)
- `F` - Month in full name (January-December/बैशाख-चैत्र)
- `d` - Day in two digits with leading zero (01-31/०१-३२)
- `j` - Day in one or two digits without leading zero (1-31/१-३२)
- `D` - Day in three letters (Sun-Sat/आइत-शनि)
- `l` - Day in full name (Sunday-Saturday/आइतबार-शनिबार)
- `S` - Day in two letters (st, nd, rd, th)

## Testing

```bash
Expand Down

0 comments on commit 6d4a9e2

Please sign in to comment.