@item-enonic-types/lib-time 1.5.0 → 1.6.0

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.
@@ -1,4 +1,5 @@
1
1
  import type { ZoneId, Locale } from "/lib/time";
2
+ import type { FormatStyle } from "/lib/time/format/format-style";
2
3
  /**
3
4
  * Formatter for printing and parsing date-time objects.
4
5
  * @see {@link https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/DateTimeFormatter.html}
@@ -26,6 +27,10 @@ export interface DateTimeFormatterConstructor {
26
27
  ISO_WEEK_DATE: DateTimeFormatter;
27
28
  ISO_ZONED_DATE_TIME: DateTimeFormatter;
28
29
  RFC_1123_DATE_TIME: DateTimeFormatter;
30
+ ofLocalizedDate(dateStyle: FormatStyle): DateTimeFormatter;
31
+ ofLocalizedTime(timeStyle: FormatStyle): DateTimeFormatter;
32
+ ofLocalizedDateTime(dateTimeStyle: FormatStyle): DateTimeFormatter;
33
+ ofLocalizedDateTime(dateStyle: FormatStyle, timeStyle: FormatStyle): DateTimeFormatter;
29
34
  ofPattern(pattern: string): DateTimeFormatter;
30
35
  ofPattern(pattern: string, locale: Locale): DateTimeFormatter;
31
36
  }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Enumeration of the style of a localized date, time or date-time formatter.
3
+ *
4
+ * These styles are used when obtaining a date-time style from configuration. See DateTimeFormatter and DateTimeFormatterBuilder for usage.
5
+ * @see {@link https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/FormatStyle.html}
6
+ */
7
+ export declare const FormatStyle: FormatStyleConstructor;
8
+ export interface FormatStyleConstructor {
9
+ FULL: FormatStyle;
10
+ LONG: FormatStyle;
11
+ MEDIUM: FormatStyle;
12
+ SHORT: FormatStyle;
13
+ valueOf(name: string): FormatStyle;
14
+ values(): FormatStyle[];
15
+ }
16
+ export interface FormatStyle {
17
+ toString(): string;
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@item-enonic-types/lib-time",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Type definitions for lib-time",
5
5
  "license": "MIT",
6
6
  "files": [