@item-enonic-types/lib-time 1.2.1 → 1.4.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.
- package/README.md +7 -3
- package/day-of-week.d.ts +10 -0
- package/format/text-style.d.ts +26 -0
- package/index.d.ts +1 -0
- package/local-date-time.d.ts +2 -0
- package/month.d.ts +16 -0
- package/package.json +13 -13
- package/zoned-date-time.d.ts +2 -0
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ repositories {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
dependencies {
|
|
22
|
-
include "no.item:lib-xp-time:1.
|
|
22
|
+
include "no.item:lib-xp-time:1.3.0"
|
|
23
23
|
}
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -154,8 +154,6 @@ To build the project, run the following command
|
|
|
154
154
|
enonic project build
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
-
You will find the jar-file at _./build/libs/item.jar_
|
|
158
|
-
|
|
159
157
|
### Deploying locally
|
|
160
158
|
|
|
161
159
|
To deploy to a local sandbox, run the following command
|
|
@@ -169,3 +167,9 @@ enonic project deploy
|
|
|
169
167
|
```bash
|
|
170
168
|
./gradlew publish -P com.enonic.xp.app.production=true
|
|
171
169
|
```
|
|
170
|
+
|
|
171
|
+
### Deploy to npm
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npm publish
|
|
175
|
+
```
|
package/day-of-week.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TextStyle } from "./format/text-style";
|
|
2
|
+
import { Locale } from "./util";
|
|
1
3
|
/**
|
|
2
4
|
* DayOfWeek is an enum representing the 7 days of the week - Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday.
|
|
3
5
|
* @see {@link https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/DayOfWeek.html}
|
|
@@ -5,11 +7,19 @@
|
|
|
5
7
|
export declare const DayOfWeek: DayOfWeekConstructor;
|
|
6
8
|
export type WeekDayNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
7
9
|
export interface DayOfWeekConstructor {
|
|
10
|
+
MONDAY: DayOfWeek;
|
|
11
|
+
TUESDAY: DayOfWeek;
|
|
12
|
+
WEDNESDAY: DayOfWeek;
|
|
13
|
+
THURSDAY: DayOfWeek;
|
|
14
|
+
FRIDAY: DayOfWeek;
|
|
15
|
+
SATURDAY: DayOfWeek;
|
|
16
|
+
SUNDAY: DayOfWeek;
|
|
8
17
|
of(dayOfWeek: WeekDayNumber): DayOfWeek;
|
|
9
18
|
valueOf(name: string): DayOfWeek;
|
|
10
19
|
values(): DayOfWeek[];
|
|
11
20
|
}
|
|
12
21
|
export interface DayOfWeek {
|
|
22
|
+
getDisplayName(style: TextStyle, locale: Locale): string;
|
|
13
23
|
getValue(): WeekDayNumber;
|
|
14
24
|
minus(days: number): DayOfWeek;
|
|
15
25
|
plus(days: number): DayOfWeek;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration of the style of text formatting and parsing.
|
|
3
|
+
*
|
|
4
|
+
* Text styles define three sizes for the formatted text - 'full', 'short' and 'narrow'. Each of these three sizes is available in both 'standard' and 'stand-alone' variations.
|
|
5
|
+
*
|
|
6
|
+
* The difference between the three sizes is obvious in most languages. For example, in English the 'full' month is 'January', the 'short' month is 'Jan' and the 'narrow' month is 'J'. Note that the narrow size is often not unique. For example, 'January', 'June' and 'July' all have the 'narrow' text 'J'.
|
|
7
|
+
*
|
|
8
|
+
* The difference between the 'standard' and 'stand-alone' forms is trickier to describe as there is no difference in English. However, in other languages there is a difference in the word used when the text is used alone, as opposed to in a complete date. For example, the word used for a month when used alone in a date picker is different to the word used for month in association with a day and year in a date.
|
|
9
|
+
* @see {@link https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/TextStyle.html}
|
|
10
|
+
*/
|
|
11
|
+
export declare const TextStyle: TextStyleConstructor;
|
|
12
|
+
export interface TextStyleConstructor {
|
|
13
|
+
FULL: TextStyle;
|
|
14
|
+
FULL_STANDALONE: TextStyle;
|
|
15
|
+
NARROW: TextStyle;
|
|
16
|
+
NARROW_STANDALONE: TextStyle;
|
|
17
|
+
SHORT: TextStyle;
|
|
18
|
+
SHORT_STANDALONE: TextStyle;
|
|
19
|
+
valueOf(name: string): TextStyle;
|
|
20
|
+
values(): TextStyle[];
|
|
21
|
+
}
|
|
22
|
+
export interface TextStyle {
|
|
23
|
+
asNormal(): TextStyle;
|
|
24
|
+
asStandalone(): TextStyle;
|
|
25
|
+
isStandalone(): boolean;
|
|
26
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { LocalDateTime } from "/lib/time/local-date-time";
|
|
|
3
3
|
export { ZonedDateTime } from "/lib/time/zoned-date-time";
|
|
4
4
|
export { Locale, LanguageRange } from "/lib/time/util";
|
|
5
5
|
export { DateTimeFormatter } from "/lib/time/format/date-time-formatter";
|
|
6
|
+
export { TextStyle } from "/lib/time/format/text-style";
|
|
6
7
|
export { Instant } from "/lib/time/instant";
|
|
7
8
|
export { LocalDate } from "/lib/time/local-date";
|
|
8
9
|
export { LocalTime } from "/lib/time/local-time";
|
package/local-date-time.d.ts
CHANGED
package/month.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { TextStyle } from "./format/text-style";
|
|
2
|
+
import type { Locale } from "./util";
|
|
1
3
|
/**
|
|
2
4
|
* A month-of-year, such as 'July'.
|
|
3
5
|
*
|
|
@@ -7,7 +9,20 @@
|
|
|
7
9
|
export declare const Month: MonthConstructor;
|
|
8
10
|
export type MonthNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
9
11
|
export interface MonthConstructor {
|
|
12
|
+
JANUARY: Month;
|
|
13
|
+
FEBRUARY: Month;
|
|
14
|
+
MARCH: Month;
|
|
15
|
+
APRIL: Month;
|
|
16
|
+
MAY: Month;
|
|
17
|
+
JUNE: Month;
|
|
18
|
+
JULY: Month;
|
|
19
|
+
AUGUST: Month;
|
|
20
|
+
SEPTEMBER: Month;
|
|
21
|
+
OCTOBER: Month;
|
|
22
|
+
NOVEMBER: Month;
|
|
23
|
+
DECEMBER: Month;
|
|
10
24
|
of(month: MonthNumber): Month;
|
|
25
|
+
valueOf(name: string): Month;
|
|
11
26
|
}
|
|
12
27
|
export interface Month {
|
|
13
28
|
getValue(): MonthNumber;
|
|
@@ -15,6 +30,7 @@ export interface Month {
|
|
|
15
30
|
hashCode(): number;
|
|
16
31
|
firstDayOfYear(leapYear: boolean): number;
|
|
17
32
|
firstMonthOfQuarter(): Month;
|
|
33
|
+
getDisplayName(style: TextStyle, locale: Locale): string;
|
|
18
34
|
length(leapYear: boolean): number;
|
|
19
35
|
maxLength(): number;
|
|
20
36
|
minLength(): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@item-enonic-types/lib-time",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Type definitions for lib-time",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
"tsconfig.json"
|
|
10
10
|
],
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@changesets/cli": "^2.
|
|
12
|
+
"@changesets/cli": "^2.29.8",
|
|
13
13
|
"@item-enonic-types/lib-testing": "^7.13.0",
|
|
14
|
-
"@swc/core": "^1.
|
|
15
|
-
"@types/node": "^
|
|
16
|
-
"eslint": "^9.
|
|
17
|
-
"eslint-config-prettier": "^10.
|
|
18
|
-
"eslint-plugin-prettier": "^5.
|
|
19
|
-
"concurrently": "^9.1
|
|
20
|
-
"glob": "^
|
|
21
|
-
"prettier": "^3.4
|
|
22
|
-
"tsup": "^8.
|
|
23
|
-
"typescript": "^5.
|
|
24
|
-
"typescript-eslint": "^8.
|
|
14
|
+
"@swc/core": "^1.15.8",
|
|
15
|
+
"@types/node": "^25.0.3",
|
|
16
|
+
"eslint": "^9.39.2",
|
|
17
|
+
"eslint-config-prettier": "^10.1.8",
|
|
18
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
19
|
+
"concurrently": "^9.2.1",
|
|
20
|
+
"glob": "^13.0.0",
|
|
21
|
+
"prettier": "^3.7.4",
|
|
22
|
+
"tsup": "^8.5.1",
|
|
23
|
+
"typescript": "^5.9.3",
|
|
24
|
+
"typescript-eslint": "^8.52.0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@item-enonic-types/nashorn-env": "^0.0.2"
|