@@ -28,15 +28,15 @@ data class PatternDateFormat @JvmOverloads constructor(
2828 }
2929
3030 fun withLocale (locale : KlockLocale ? ) = this .copy(locale = locale)
31- fun withTimezoneNames (tzNames : TimezoneNames ) = this .copy(tzNames = this .tzNames + tzNames)
31+ fun withTimezoneNames (tzNames : TimezoneNames ) = this .copy(tzNames = this .tzNames + tzNames)
3232 fun withOptions (options : Options ) = this .copy(options = options)
3333 fun withOptional () = this .copy(options = options.copy(optionalSupport = true ))
3434 fun withNonOptional () = this .copy(options = options.copy(optionalSupport = false ))
3535
3636 private val openOffsets = LinkedHashMap <Int , Int >()
3737 private val closeOffsets = LinkedHashMap <Int , Int >()
3838
39- internal val chunks = arrayListOf<String >().also { chunks ->
39+ internal val chunks = arrayListOf<String >().also { chunks ->
4040 val s = MicroStrReader (format)
4141 while (s.hasMore) {
4242 if (s.peekChar() == ' \' ' ) {
@@ -62,7 +62,7 @@ data class PatternDateFormat @JvmOverloads constructor(
6262 }
6363 }.toList()
6464
65- internal val regexChunks = chunks.map {
65+ internal val regexChunks = chunks.map {
6666 when (it) {
6767 " E" , " EE" , " EEE" , " EEEE" , " EEEEE" , " EEEEEE" -> """ (\w+)"""
6868 " z" , " zzz" -> """ ([\w\s\-+:]+)"""
@@ -104,8 +104,8 @@ data class PatternDateFormat @JvmOverloads constructor(
104104 }
105105 }
106106
107- // val escapedFormat = Regex.escape(format)
108- internal val rx2: Regex = Regex (" ^" + regexChunks.mapIndexed { index, it ->
107+ // val escapedFormat = Regex.escape(format)
108+ internal val rx2: Regex = Regex (" ^" + regexChunks.mapIndexed { index, it ->
109109 if (options.optionalSupport) {
110110 val opens = openOffsets.getOrElse(index) { 0 }
111111 val closes = closeOffsets.getOrElse(index) { 0 }
@@ -120,7 +120,7 @@ data class PatternDateFormat @JvmOverloads constructor(
120120 }.joinToString(" " ) + " $" )
121121
122122
123- // EEE, dd MMM yyyy HH:mm:ss z -- > Sun, 06 Nov 1994 08:49:37 GMT
123+ // EEE, dd MMM yyyy HH:mm:ss z -- > Sun, 06 Nov 1994 08:49:37 GMT
124124 // YYYY-MM-dd HH:mm:ss
125125
126126 override fun format (dd : DateTimeTz ): String {
@@ -180,9 +180,9 @@ data class PatternDateFormat @JvmOverloads constructor(
180180 }
181181 " a" -> if (utc.hours < 12 ) " am" else " pm"
182182 else -> when {
183- name.startsWith(' \' ' ) -> name.substring(1 , name.length - 1 )
184- else -> name
185- }
183+ name.startsWith(' \' ' ) -> name.substring(1 , name.length - 1 )
184+ else -> name
185+ }
186186 }
187187 }
188188 return out
0 commit comments