Skip to content

Commit

Permalink
Test non standard locales
Browse files Browse the repository at this point in the history
  • Loading branch information
cquiroz committed Jul 21, 2016
1 parent b25c5e9 commit 21c2f4b
Show file tree
Hide file tree
Showing 2 changed files with 388 additions and 45 deletions.
4 changes: 0 additions & 4 deletions core/src/main/scala/java/text/DateFormat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ object DateFormat {

final def getDateInstance(style: Int, aLocale: Locale): DateFormat =
LocaleRegistry.ldml(aLocale).flatMap { ldml =>
//val ptrn = parentPatterns(ldml).flatMap(_.datePatterns.get(style))
val ptrn = patternsR(ldml, _.datePatterns.get(style))
println(ptrn)
ptrn.map(new SimpleDateFormat(_, aLocale))
}.getOrElse(new SimpleDateFormat("", aLocale))

Expand All @@ -90,9 +88,7 @@ object DateFormat {

final def getDateTimeInstance(dateStyle: Int, timeStyle: Int, aLocale: Locale): DateFormat =
LocaleRegistry.ldml(aLocale).flatMap { ldml =>
//val datePtrn = parentPatterns(ldml).flatMap(_.datePatterns.get(dateStyle))
val datePtrn = patternsR(ldml, _.datePatterns.get(dateStyle))
//val timePtrn = parentPatterns(ldml).flatMap(_.timePatterns.get(timeStyle))
val timePtrn = patternsR(ldml, _.timePatterns.get(timeStyle))
(datePtrn, timePtrn) match {
case (Some(d), Some(t)) => Some(new SimpleDateFormat(s"$d $t", aLocale))
Expand Down
Loading

0 comments on commit 21c2f4b

Please sign in to comment.