From a2ba82033f51d6c97bc3bfdc59644c86346fde32 Mon Sep 17 00:00:00 2001 From: exoego Date: Sat, 26 Oct 2019 19:55:12 +0900 Subject: [PATCH] Locales is optional. Options can be passed when locales is undefined --- .../scala/org/scalajs/dom/experimental/intl/Intl.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala b/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala index 99d13fd69..b2400f204 100644 --- a/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala +++ b/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala @@ -35,7 +35,8 @@ class Collator(locales: js.UndefOr[String | js.Array[String]] = js.undefined, */ @js.native @JSGlobal("Intl.DateTimeFormat") -class DateTimeFormat(locales: String | js.Array[String], +class DateTimeFormat( + locales: js.UndefOr[String | js.Array[String]] = js.undefined, options: js.UndefOr[DateTimeFormatOptions] = js.undefined) extends js.Object { def format(date: js.Date): String = js.native @@ -52,8 +53,9 @@ class DateTimeFormat(locales: String | js.Array[String], */ @js.native @JSGlobal("Intl.NumberFormat") -class NumberFormat(locales: String | js.Array[String], - options: js.UndefOr[NumberFormatOptions]) +class NumberFormat( + locales: js.UndefOr[String | js.Array[String]] = js.undefined, + options: js.UndefOr[NumberFormatOptions] = js.undefined) extends js.Object { def format(number: Double): String = js.native def resolvedOptions(): NumberFormatOptions = js.native