Skip to content

Commit 91af7bb

Browse files
committed
Ensure tests pass with system language other than English
1 parent bde2a40 commit 91af7bb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/primitives/TimePrimitives.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package org.nlogo.extensions.time.primitives
22

33
import java.time.format.DateTimeFormatter
44
import java.time.format.ResolverStyle.STRICT
5-
import org.nlogo.api.Argument
6-
import org.nlogo.api.Context
7-
import org.nlogo.api.Reporter
8-
import org.nlogo.core.Syntax
5+
6+
import org.nlogo.api.{ Argument, Context, Reporter }
7+
import org.nlogo.core.{ I18N, Syntax }
98
import org.nlogo.nvm.ExtensionContext
9+
1010
import org.nlogo.extensions.time._
1111
import org.nlogo.extensions.time.datatypes._
1212

@@ -56,8 +56,8 @@ object TimePrimitives {
5656
val fmtString: String = TimeUtils.getStringFromArgument(args, 1)
5757
val fmt =
5858
if (fmtString.trim().==(""))
59-
DateTimeFormatter.ofPattern("uuuu-MM-dd HH:mm:ss.SSS").withResolverStyle(STRICT)
60-
else DateTimeFormatter.ofPattern(fmtString.replace('y','u')).withResolverStyle(STRICT)
59+
DateTimeFormatter.ofPattern("uuuu-MM-dd HH:mm:ss.SSS", I18N.shared.defaultLocale).withResolverStyle(STRICT)
60+
else DateTimeFormatter.ofPattern(fmtString.replace('y','u'), I18N.shared.defaultLocale).withResolverStyle(STRICT)
6161
time.show(fmt)
6262
}
6363
}

0 commit comments

Comments
 (0)