playbook_ui 12.31.0.pre.alpha.PLAY814removemomentjs933 → 12.31.0.pre.alpha.PLAY814removemomentjs935

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fea30ab1eb68b157b59551e983c188dc54b84a10e9298dd872177400ab2d5a1f
4
- data.tar.gz: 4f29ee0e00f034cbfa461400630bb81162fb1af25f9898151fbf1c232039de17
3
+ metadata.gz: 12c72ae84aaba7e1edcd0dfa0d33ad7a056d475b963f41cc3a51e3659b07a94e
4
+ data.tar.gz: d81b816085e404d1f6925d3f80437eb797fdf5f6075002d450e38522112a6ce5
5
5
  SHA512:
6
- metadata.gz: 22232422c782273e028e8f89ab1a1443dbcc1e3007c67510d8571adee8bc5011f204e4f59e069659ae680e418713b4bed55832c2bb08f879ce4d8d9c7d2b2f23
7
- data.tar.gz: 327b369dbe832a1b307c475988368a4b0611d29198a8bb42f77104dc1bf02e17eb2e2cbe75e373702e5206c05a21f8cf5f8e6d1d641b2f91451214450635cffd
6
+ metadata.gz: b53032ddaf3933c0a8021e6422bff0d66cfa320bd42d0462986d13a8862143ec3247ca93699ab785b18b88fdeea93e19540bbc11417048e3e2dd419866b73a6c
7
+ data.tar.gz: f3894884ee10180698f98b80be21a6889bd23575d0c8e55914f946ee4ba01a0fbf4dd08512e357f34fd383fb6c972c2c35923ac1fae6ae4bce4123cc8dfc52be
@@ -4,7 +4,7 @@ const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
4
4
 
5
5
  const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
6
6
 
7
- export const toMinute = (newDate: Date, timeZone?: string): string => {
7
+ export const toMinute = (newDate: Date | string, timeZone?: string): string => {
8
8
  const date = new Date(newDate)
9
9
  if (timeZone) {
10
10
  return date.toLocaleTimeString(undefined, {timeZone, hour: "2-digit", minute: "2-digit"}).slice(3, 5);
@@ -13,7 +13,7 @@ export const toMinute = (newDate: Date, timeZone?: string): string => {
13
13
  }
14
14
  }
15
15
 
16
- export const toHour = (newDate: Date, timeZone?: string): string => {
16
+ export const toHour = (newDate: Date | string, timeZone?: string): string => {
17
17
  const date = new Date(newDate)
18
18
  if (timeZone) {
19
19
  return date.toLocaleTimeString(undefined, {timeZone, hour: "numeric"}).split(' ')[0];
@@ -22,27 +22,27 @@ export const toHour = (newDate: Date, timeZone?: string): string => {
22
22
  }
23
23
  }
24
24
 
25
- export const toDay = (newDate: Date, timeZone?: string): number => {
25
+ export const toDay = (newDate: Date | string, timeZone?: string): number => {
26
26
  if (timeZone) {
27
27
  const date = new Date(newDate.toLocaleString(undefined, { timeZone }));
28
- return date.getUTCDate()
28
+ return date.getDate()
29
29
  } else {
30
30
  const date = new Date(newDate)
31
- return date.getUTCDate()
31
+ return date.getDate()
32
32
  }
33
33
  }
34
34
 
35
- export const toDayAbbr = (newDate: Date): string => {
35
+ export const toDayAbbr = (newDate: Date | string): string => {
36
36
  const date = new Date(newDate)
37
37
  return ABBR_DAYS[date.getUTCDay()]
38
38
  }
39
39
 
40
- export const toWeekday = (newDate: Date): string => {
40
+ export const toWeekday = (newDate: Date | string): string => {
41
41
  const date = new Date(newDate)
42
42
  return days[date.getUTCDay()]
43
43
  }
44
44
 
45
- export const toMonth = (newDate: Date, timeZone?: string): string => {
45
+ export const toMonth = (newDate: Date | string, timeZone?: string): string => {
46
46
  if (timeZone) {
47
47
  const date = new Date(newDate.toLocaleString(undefined, { timeZone }));
48
48
  return months[date.getUTCMonth()]
@@ -52,12 +52,12 @@ export const toMonth = (newDate: Date, timeZone?: string): string => {
52
52
  }
53
53
  }
54
54
 
55
- export const toMonthNum = (newDate: Date): number => {
55
+ export const toMonthNum = (newDate: Date | string): number => {
56
56
  const date = new Date(newDate)
57
57
  return date.getUTCMonth() +1
58
58
  }
59
59
 
60
- export const toYear = (newDate: Date, timeZone?: string): number => {
60
+ export const toYear = (newDate: Date | string, timeZone?: string): number => {
61
61
  if (timeZone) {
62
62
  const date = new Date(newDate.toLocaleString(undefined, { timeZone }));
63
63
  return date.getUTCFullYear()
@@ -67,7 +67,7 @@ export const toYear = (newDate: Date, timeZone?: string): number => {
67
67
  }
68
68
  }
69
69
 
70
- export const toTime = (newDate: Date, timeZone?: string): string => {
70
+ export const toTime = (newDate: Date | string, timeZone?: string): string => {
71
71
  const date = new Date(newDate)
72
72
  if (timeZone) {
73
73
  return date.toLocaleTimeString(undefined, {timeZone, timeStyle: "short"}).split(' ')[0];
@@ -76,7 +76,7 @@ export const toTime = (newDate: Date, timeZone?: string): string => {
76
76
  }
77
77
  }
78
78
 
79
- export const toMeridiem = (newDate: Date, timeZone?: string): string => {
79
+ export const toMeridiem = (newDate: Date | string, timeZone?: string): string => {
80
80
  const date = new Date(newDate)
81
81
  if (timeZone) {
82
82
  return date.toLocaleString(undefined, {timeZone, hour12: true }).slice(-2).charAt(0).toLocaleLowerCase();
@@ -85,7 +85,7 @@ export const toMeridiem = (newDate: Date, timeZone?: string): string => {
85
85
  }
86
86
  }
87
87
 
88
- export const toTimeZone = (newDate: Date, timeZone?: string): string => {
88
+ export const toTimeZone = (newDate: Date | string, timeZone?: string): string => {
89
89
  const date = new Date(newDate)
90
90
  if (timeZone) {
91
91
  return date.toLocaleString(undefined, {timeZone, timeZoneName: "short"}).split(' ')[3];
@@ -94,17 +94,17 @@ export const toTimeZone = (newDate: Date, timeZone?: string): string => {
94
94
  }
95
95
  }
96
96
 
97
- export const toTimeWithMeridiem = (newDate: Date, timeZone: string): string => {
97
+ export const toTimeWithMeridiem = (newDate: Date | string, timeZone: string): string => {
98
98
  const date = new Date(newDate)
99
99
  return `${toTime(date, timeZone)}${toMeridiem(date, timeZone)}`;
100
100
  }
101
101
 
102
- export const toIso = (newDate: Date): string => {
102
+ export const toIso = (newDate: Date | string): string => {
103
103
  const date = new Date(newDate)
104
104
  return date.toISOString()
105
105
  }
106
106
 
107
- export const fromNow = (newDate: Date): string => {
107
+ export const fromNow = (newDate: Date | string): string => {
108
108
 
109
109
  const startDate = new Date(newDate).getTime()
110
110
  const endDate = new Date().getTime()
@@ -134,7 +134,7 @@ export const fromNow = (newDate: Date): string => {
134
134
  return elapsedTimeString
135
135
  }
136
136
 
137
- export const toCustomFormat = (newDate: Date, format = 'month_day'): string => {
137
+ export const toCustomFormat = (newDate: Date | string, format = 'month_day'): string => {
138
138
  const date = new Date(newDate)
139
139
  if (format == "month_day") {
140
140
  return `${toMonthNum(date)}/${toDay(date)}`
@@ -23,7 +23,7 @@ type MessageProps = {
23
23
  id?: string,
24
24
  label?: string,
25
25
  message: string,
26
- timestamp?: Date,
26
+ timestamp?: string,
27
27
  timestampObject?: Date,
28
28
  timezone?: string,
29
29
  alignTimestamp?: string,
@@ -88,8 +88,8 @@ const Message = (props: MessageProps) => {
88
88
  }
89
89
  <Timestamp
90
90
  className={`pull-${alignTimestamp} ${timestampObject ? 'message_humanized_time' : null}`}
91
- text={timestamp.toString()}
92
- timestamp={null}
91
+ text={timestamp}
92
+ timestamp={''}
93
93
  timezone={timezone}
94
94
  />
95
95
  {timestampObject &&
@@ -53,27 +53,26 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
53
53
  className
54
54
  )
55
55
 
56
- const timeStamp = new Date(timestamp)
57
56
  const currentYear = new Date().getFullYear().toString()
58
- const dateDisplay = `${DateTime.toMonth(timeStamp, timezone)} ${DateTime.toDay(timeStamp, timezone)}`
57
+ const dateDisplay = `${DateTime.toMonth(timestamp, timezone)} ${DateTime.toDay(timestamp, timezone)}`
59
58
  const shouldShowUser = showUser == true && text.length > 0
60
59
  const shouldShowTimezone = showTimezone == true && timezone.length > 0
61
60
  const updatedText = hideUpdated ? "" : "Last updated"
62
61
  const userDisplay = shouldShowUser ? ` by ${text}` : ''
63
62
 
64
- let timeDisplay = `${DateTime.toHour(timeStamp, timezone)}:${DateTime.toMinute(timeStamp, timezone)}${DateTime.toMeridiem(timeStamp, timezone)}`
63
+ let timeDisplay = `${DateTime.toHour(timestamp, timezone)}:${DateTime.toMinute(timestamp, timezone)}${DateTime.toMeridiem(timestamp, timezone)}`
65
64
 
66
65
  const fullTimeDisplay = () => {
67
66
  if (shouldShowTimezone) {
68
- timeDisplay = `${timeDisplay} ${DateTime.toTimeZone(timeStamp, timezone)}`
67
+ timeDisplay = `${timeDisplay} ${DateTime.toTimeZone(timestamp, timezone)}`
69
68
  }
70
69
  return timeDisplay
71
70
  }
72
71
 
73
72
  const fullDateDisplay = () => {
74
- let fullDisplay = `${DateTime.toMonth(timeStamp, timezone)} ${DateTime.toDay(timeStamp, timezone)}`
75
- if (DateTime.toYear(timeStamp, timezone).toString() !== currentYear) {
76
- fullDisplay = `${fullDisplay}, ${DateTime.toYear(timeStamp, timezone)}`
73
+ let fullDisplay = `${DateTime.toMonth(timestamp, timezone)} ${DateTime.toDay(timestamp, timezone)}`
74
+ if (DateTime.toYear(timestamp, timezone).toString() !== currentYear) {
75
+ fullDisplay = `${fullDisplay}, ${DateTime.toYear(timestamp, timezone)}`
77
76
  }
78
77
  return `${fullDisplay} ${' \u00b7 '} ${fullTimeDisplay()}`
79
78
  }
@@ -83,7 +82,7 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
83
82
  }
84
83
 
85
84
  const formatElapsedString = () => {
86
- return `${updatedText} ${userDisplay} ${DateTime.fromNow(timeStamp)}`
85
+ return `${updatedText} ${userDisplay} ${DateTime.fromNow(timestamp)}`
87
86
  }
88
87
 
89
88
  const captionText = () => {
@@ -93,7 +92,7 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
93
92
  case 'elapsed':
94
93
  return formatElapsedString()
95
94
  default:
96
- return showDate ? timeStamp ? fullDateDisplay() : text : fullTimeDisplay()
95
+ return showDate ? timestamp ? fullDateDisplay() : text : fullTimeDisplay()
97
96
  }
98
97
  }
99
98
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "12.31.0"
5
- VERSION = "12.31.0.pre.alpha.PLAY814removemomentjs933"
5
+ VERSION = "12.31.0.pre.alpha.PLAY814removemomentjs935"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.31.0.pre.alpha.PLAY814removemomentjs933
4
+ version: 12.31.0.pre.alpha.PLAY814removemomentjs935
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-07-14 00:00:00.000000000 Z
12
+ date: 2023-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack