Skip to content

Commit

Permalink
Update README.md for time support
Browse files Browse the repository at this point in the history
  • Loading branch information
shivathapaa authored Sep 7, 2024
1 parent 4bea6e5 commit 0c9575a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ The library provides a basic set of types/features for working with date picker:

Using this library you can get following things done.

### Getting today's Nepali date
### Getting today's date and current time

```kotlin
NepaliDateConverter.todayNepaliDate

NepaliDateConverter.todayEnglishDate

NepaliDateConverter.currentTime
```

### Converting English date to Nepali date
Expand Down Expand Up @@ -89,6 +93,17 @@ val locale = NepaliDateLocale(
)
val formattedDate = NepaliDateConverter.formatNepaliDate(customCalendar, locale)
// formattedDate: "Monday, Asar 11, 2080"


// Time formatter

NepaliDateConverter.getFormattedTimeInNepali(NepaliDateConverter.currentTime) // Output: "साँझ ४ : ३०"

NepaliDateConverter.getFormattedTimeInNepali(NepaliDateConverter.currentTime, use12HourFormat = false) // Output: "१६ : ३०"

NepaliDateConverter.getFormattedTimeInEnglish(NepaliDateConverter.currentTime) // Output: "4:30 PM"

NepaliDateConverter.getFormattedTimeInEnglish(NepaliDateConverter.currentTime, use12HourFormat = false) // Output: "16:30"
```

## Using in your projects
Expand Down

0 comments on commit 0c9575a

Please sign in to comment.