Skip to content

Commit 7c5323e

Browse files
committed
[CLEANUP] Re-use constant defined
1 parent 94eb2df commit 7c5323e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/kotlin/dev/hossain/time/InstantExtension.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.hossain.time
22

3+
import dev.hossain.time.UserCity.NEW_YORK
34
import kotlinx.datetime.Instant
45
import kotlinx.datetime.toJavaInstant
56
import java.time.ZonedDateTime
@@ -9,7 +10,7 @@ import java.time.ZonedDateTime
910
*/
1011
fun Instant.toZdt(): ZonedDateTime {
1112
val javaInstant: java.time.Instant = this.toJavaInstant()
12-
return javaInstant.atZone(Zone.city("New York"))
13+
return javaInstant.atZone(Zone.city(NEW_YORK))
1314
}
1415

1516
/**

0 commit comments

Comments
 (0)