Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
aminography committed Dec 29, 2021
2 parents e9e4b65 + 6b24a42 commit 12bdbbe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Add the following lines to your `build.gradle` file:

```gradle
dependencies {
implementation 'com.aminography:primecalendar:1.4.0'
implementation 'com.aminography:primecalendar:1.4.1'
}
```

Expand All @@ -39,7 +39,7 @@ Add the following lines to your `pom.xml` file:
<dependency>
<groupId>com.aminography</groupId>
<artifactId>primecalendar</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</dependency>
</dependencies>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,25 +521,25 @@ abstract class PrimeCalendar(
* Returns an instance of [CivilCalendar] which is equivalent to the time of the current calendar.
*/
fun toCivil(): CivilCalendar =
CivilCalendar().also { it.timeInMillis = timeInMillis }
CivilCalendar(internalCalendar.timeZone, locale).also { it.timeInMillis = timeInMillis }

/**
* Returns an instance of [PersianCalendar] which is equivalent to the time of the current calendar.
*/
fun toPersian(): PersianCalendar =
PersianCalendar().also { it.timeInMillis = timeInMillis }
PersianCalendar(internalCalendar.timeZone, locale).also { it.timeInMillis = timeInMillis }

/**
* Returns an instance of [HijriCalendar] which is equivalent to the time of the current calendar.
*/
fun toHijri(): HijriCalendar =
HijriCalendar().also { it.timeInMillis = timeInMillis }
HijriCalendar(internalCalendar.timeZone, locale).also { it.timeInMillis = timeInMillis }

/**
* Returns an instance of [JapaneseCalendar] which is equivalent to the time of the current calendar.
*/
fun toJapanese(): JapaneseCalendar =
JapaneseCalendar().also { it.timeInMillis = timeInMillis }
JapaneseCalendar(internalCalendar.timeZone, locale).also { it.timeInMillis = timeInMillis }

// ---------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -854,7 +854,14 @@ abstract class PrimeCalendar(
}
}

private fun checkDisplayNameParams(field: Int, style: Int, minStyle: Int, maxStyle: Int, locale: Locale?, vararg fields: Int): Boolean {
private fun checkDisplayNameParams(
field: Int,
style: Int,
minStyle: Int,
maxStyle: Int,
locale: Locale?,
vararg fields: Int
): Boolean {
if (field < 0 || field >= FIELD_COUNT || style < minStyle || style > maxStyle) {
throw IllegalArgumentException()
}
Expand Down

0 comments on commit 12bdbbe

Please sign in to comment.