@colisweb/rescript-toolkit 2.58.2 → 2.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -97,25 +97,25 @@ module Intl = {
|
|
|
97
97
|
@get external messages: t => Js.Dict.t<string> = "messages"
|
|
98
98
|
@get external defaultLocale: t => string = "defaultLocale"
|
|
99
99
|
@get external defaultFormats: t => {..} = "defaultFormats"
|
|
100
|
-
@
|
|
101
|
-
@
|
|
100
|
+
@send external formatDate: (t, Js.Date.t) => string = "formatDate"
|
|
101
|
+
@send
|
|
102
102
|
external formatDateToParts: (t, Js.Date.t) => array<part> = "formatDateToParts"
|
|
103
|
-
@
|
|
103
|
+
@send
|
|
104
104
|
external formatDateWithOptions: (t, Js.Date.t, dateTimeFormatOptions) => string = "formatDate"
|
|
105
|
-
@
|
|
105
|
+
@send
|
|
106
106
|
external formatDateWithOptionsToParts: (t, Js.Date.t, dateTimeFormatOptions) => array<part> =
|
|
107
107
|
"formatDateToParts"
|
|
108
|
-
@
|
|
109
|
-
@
|
|
108
|
+
@send external formatTime: (t, Js.Date.t) => string = "formatTime"
|
|
109
|
+
@send
|
|
110
110
|
external formatTimeToParts: (t, Js.Date.t) => array<part> = "formatTimeToParts"
|
|
111
|
-
@
|
|
111
|
+
@send
|
|
112
112
|
external formatTimeWithOptions: (t, Js.Date.t, dateTimeFormatOptions) => string = "formatTime"
|
|
113
|
-
@
|
|
113
|
+
@send
|
|
114
114
|
external formatTimeWithOptionsToParts: (t, Js.Date.t, dateTimeFormatOptions) => array<part> =
|
|
115
115
|
"formatTimeToParts"
|
|
116
|
-
@
|
|
116
|
+
@send
|
|
117
117
|
external formatRelativeTime: (t, float) => string = "formatRelativeTime"
|
|
118
|
-
@
|
|
118
|
+
@send
|
|
119
119
|
external formatRelativeTimeWithUnit: (
|
|
120
120
|
t,
|
|
121
121
|
float,
|
|
@@ -130,7 +130,7 @@ module Intl = {
|
|
|
130
130
|
| #year
|
|
131
131
|
],
|
|
132
132
|
) => string = "formatRelativeTime"
|
|
133
|
-
@
|
|
133
|
+
@send
|
|
134
134
|
external formatRelativeTimeWithUnitAndOptions: (
|
|
135
135
|
t,
|
|
136
136
|
float,
|
|
@@ -146,26 +146,26 @@ module Intl = {
|
|
|
146
146
|
],
|
|
147
147
|
relativeTimeFormatOptions,
|
|
148
148
|
) => string = "formatRelativeTime"
|
|
149
|
-
@
|
|
150
|
-
@
|
|
149
|
+
@send external formatNumber: (t, float) => string = "formatNumber"
|
|
150
|
+
@send
|
|
151
151
|
external formatNumberToParts: (t, float) => array<part> = "formatNumberToParts"
|
|
152
|
-
@
|
|
152
|
+
@send
|
|
153
153
|
external formatNumberWithOptions: (t, float, numberFormatOptions) => string = "formatNumber"
|
|
154
|
-
@
|
|
154
|
+
@send
|
|
155
155
|
external formatNumberWithOptionsToParts: (t, float, numberFormatOptions) => array<part> =
|
|
156
156
|
"formatNumberToParts"
|
|
157
|
-
@
|
|
158
|
-
@
|
|
157
|
+
@send external formatPlural: (t, int) => string = "formatPlural"
|
|
158
|
+
@send
|
|
159
159
|
external formatPluralWithOptions: (t, int, pluralFormatOptions) => string = "formatPlural"
|
|
160
|
-
@
|
|
161
|
-
@
|
|
160
|
+
@send external formatMessage: (t, message) => string = "formatMessage"
|
|
161
|
+
@send
|
|
162
162
|
external formatMessageWithValues: (t, message, {..}) => string = "formatMessage"
|
|
163
|
-
@
|
|
164
|
-
@
|
|
163
|
+
@send external formatList: (t, array<string>) => string = "formatList"
|
|
164
|
+
@send
|
|
165
165
|
external formatListWithOptions: (t, array<string>, listFormatOptions) => string = "formatList"
|
|
166
|
-
@
|
|
166
|
+
@send
|
|
167
167
|
external formatDisplayName: (t, string) => string = "formatDisplayName"
|
|
168
|
-
@
|
|
168
|
+
@send
|
|
169
169
|
external formatDisplayNameWithOptions: (t, string, displayNameFormatOptions) => string =
|
|
170
170
|
"formatDisplayName"
|
|
171
171
|
}
|
|
@@ -346,6 +346,19 @@ module FormattedTimeParts = {
|
|
|
346
346
|
) => React.element = "FormattedTimeParts"
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
+
module FormattedTimeWithSeparator = {
|
|
350
|
+
@react.component
|
|
351
|
+
let make = (~value: Js.Date.t, ~separator=?, ~minute=?, ~second=?, ~timeZone=?, ~hour12=?) => {
|
|
352
|
+
<FormattedTimeParts value ?minute ?second ?timeZone ?hour12>
|
|
353
|
+
{(~formattedTimeParts) => {
|
|
354
|
+
let (hours, sep, minutes) = formattedTimeParts->Obj.magic
|
|
355
|
+
|
|
356
|
+
`${hours.value}${separator->Option.getWithDefault(sep.value)}${minutes.value}`->React.string
|
|
357
|
+
}}
|
|
358
|
+
</FormattedTimeParts>
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
349
362
|
module FormattedRelativeTime = {
|
|
350
363
|
@react.component @module("react-intl")
|
|
351
364
|
external make: (
|