playbook_ui 12.39.0.pre.alpha.salesbookmismatchingdate1117 → 13.0.0.pre.alpha.salesbookmismatchingdate1120
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_kit/dateTime.ts +14 -14
- data/dist/playbook-rails.js +5 -5
- data/lib/playbook/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5e814815e52260f723ffe7d60a15296ebe7c522dbaf99e1635aa32d72c30264
|
4
|
+
data.tar.gz: 91ddc7e14810c34ecb755a4036e059d771ac84532b73d050a5ddb8fb9b02d659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40f47045dd3d5db61e4b75d1015cbb10229bf6a22a44af748a77db1084ae9f610699b882cd15d32cc969eb401ea6f89f83803cbc6a449cb4a46a2bda8d44d3e1
|
7
|
+
data.tar.gz: 79237b4941b973520b016f302f8170f91893855a748da55c9b3c5e21ce42eea6331b41201ae31cb196de215dbffc51c35231d086afe3c2c879ec4fbb541e9899
|
@@ -19,9 +19,9 @@ export const toMinute = (newDate: Date | string, timeZone?: string): string => {
|
|
19
19
|
const date = formatDate(newDate)
|
20
20
|
|
21
21
|
if (timeZone) {
|
22
|
-
return date.toLocaleTimeString(
|
22
|
+
return date.toLocaleTimeString("en-US", { timeZone, hour: "2-digit", minute: "2-digit" }).slice(3, 5);
|
23
23
|
} else {
|
24
|
-
return date.toLocaleTimeString(
|
24
|
+
return date.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" }).slice(3, 5);
|
25
25
|
}
|
26
26
|
}
|
27
27
|
|
@@ -29,15 +29,15 @@ export const toHour = (newDate: Date | string, timeZone?: string): string => {
|
|
29
29
|
const date = formatDate(newDate)
|
30
30
|
|
31
31
|
if (timeZone) {
|
32
|
-
return date.toLocaleTimeString(
|
32
|
+
return date.toLocaleTimeString("en-US", { timeZone, hour: "numeric" }).split(' ')[0];
|
33
33
|
} else {
|
34
|
-
return date.toLocaleTimeString(
|
34
|
+
return date.toLocaleTimeString("en-US", { hour: "numeric" }).split(' ')[0];
|
35
35
|
}
|
36
36
|
}
|
37
37
|
|
38
38
|
export const toDay = (newDate: Date | string, timeZone?: string): number => {
|
39
39
|
if (timeZone) {
|
40
|
-
const date = new Date(formatDate(newDate).toLocaleString(
|
40
|
+
const date = new Date(formatDate(newDate).toLocaleString("en-US", { timeZone }));
|
41
41
|
return date.getDate()
|
42
42
|
} else {
|
43
43
|
const date = formatDate(newDate)
|
@@ -57,7 +57,7 @@ export const toWeekday = (newDate: Date | string): string => {
|
|
57
57
|
|
58
58
|
export const toMonth = (newDate: Date | string, timeZone?: string): string => {
|
59
59
|
if (timeZone) {
|
60
|
-
const date = new Date(formatDate(newDate).toLocaleString(
|
60
|
+
const date = new Date(formatDate(newDate).toLocaleString("en-US", { timeZone }));
|
61
61
|
return months[date.getMonth()]
|
62
62
|
} else {
|
63
63
|
const date = formatDate(newDate)
|
@@ -72,7 +72,7 @@ export const toMonthNum = (newDate: Date | string): number => {
|
|
72
72
|
|
73
73
|
export const toYear = (newDate: Date | string, timeZone?: string): number => {
|
74
74
|
if (timeZone) {
|
75
|
-
const date = new Date(formatDate(newDate).toLocaleString(
|
75
|
+
const date = new Date(formatDate(newDate).toLocaleString("en-US", { timeZone }));
|
76
76
|
return date.getFullYear()
|
77
77
|
} else {
|
78
78
|
const date = formatDate(newDate)
|
@@ -84,9 +84,9 @@ export const toTime = (newDate: Date | string, timeZone?: string): string => {
|
|
84
84
|
const date = formatDate(newDate)
|
85
85
|
|
86
86
|
if (timeZone) {
|
87
|
-
return date.toLocaleTimeString(
|
87
|
+
return date.toLocaleTimeString("en-US", { timeZone, timeStyle: "short" }).split(' ')[0];
|
88
88
|
} else {
|
89
|
-
return date.toLocaleTimeString(
|
89
|
+
return date.toLocaleTimeString("en-US", { timeStyle: "short" }).split(' ')[0];
|
90
90
|
}
|
91
91
|
}
|
92
92
|
|
@@ -94,9 +94,9 @@ export const toMeridiem = (newDate: Date | string, timeZone?: string): string =>
|
|
94
94
|
const date = formatDate(newDate)
|
95
95
|
|
96
96
|
if (timeZone) {
|
97
|
-
return date.toLocaleString(
|
97
|
+
return date.toLocaleString("en-US", { timeZone, hour12: true }).slice(-2).charAt(0).toLocaleLowerCase();
|
98
98
|
} else {
|
99
|
-
return date.toLocaleString(
|
99
|
+
return date.toLocaleString("en-US", { hour12: true }).slice(-2).charAt(0).toLocaleLowerCase();
|
100
100
|
}
|
101
101
|
}
|
102
102
|
|
@@ -104,9 +104,9 @@ export const toTimeZone = (newDate: Date | string, timeZone?: string): string =>
|
|
104
104
|
const date = formatDate(newDate)
|
105
105
|
|
106
106
|
if (timeZone) {
|
107
|
-
return date.toLocaleString(
|
107
|
+
return date.toLocaleString("en-US", { timeZone, timeZoneName: "short" }).split(' ')[3];
|
108
108
|
} else {
|
109
|
-
return date.toLocaleString(
|
109
|
+
return date.toLocaleString("en-US", { timeZoneName: "short" }).split(' ')[3];
|
110
110
|
}
|
111
111
|
}
|
112
112
|
|
@@ -156,7 +156,7 @@ export const toCustomFormat = (newDate: Date | string, format = 'month_day'): st
|
|
156
156
|
if (format == "month_day") {
|
157
157
|
return `${toMonthNum(date)}/${toDay(date)}`
|
158
158
|
} else {
|
159
|
-
return `${date.toLocaleString(
|
159
|
+
return `${date.toLocaleString("en-US", { month: "short" })} ${toDay(date)}`
|
160
160
|
}
|
161
161
|
}
|
162
162
|
|