playbook_ui 12.39.0 → 13.0.0.pre.alpha.PLAY966collapsiblenav41126
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_collapsible/child_kits/CollapsibleMain.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +18 -8
- data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +45 -39
- data/app/pb_kits/playbook/pb_kit/dateTime.ts +204 -1
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +16 -14
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +86 -115
- data/app/pb_kits/playbook/pb_nav/_collapsible_trail_mixin.scss +14 -0
- data/app/pb_kits/playbook/pb_nav/_horizontal_nav.scss +58 -57
- data/app/pb_kits/playbook/pb_nav/_item.tsx +234 -138
- data/app/pb_kits/playbook/pb_nav/_nav.scss +38 -0
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +17 -1
- data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +9 -11
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +50 -58
- data/app/pb_kits/playbook/pb_nav/docs/_block_no_title_nav.jsx +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_borderless_nav.jsx +4 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +4 -4
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +4 -10
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.jsx +5 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.html.erb +12 -12
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.jsx +13 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.md +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_no_highlight_nav.jsx +4 -1
- data/app/pb_kits/playbook/pb_nav/docs/_subtle_nav.jsx +4 -1
- data/app/pb_kits/playbook/pb_nav/docs/_subtle_with_icons_nav.jsx +4 -1
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +5 -5
- data/app/pb_kits/playbook/pb_nav/item.html.erb +19 -12
- data/app/pb_kits/playbook/pb_nav/item.rb +55 -14
- data/app/pb_kits/playbook/pb_nav/nav.html.erb +3 -1
- data/app/pb_kits/playbook/pb_nav/navTypes.ts +25 -0
- data/dist/playbook-rails.js +7 -279
- data/lib/playbook/version.rb +2 -2
- metadata +9 -8
- data/app/pb_kits/playbook/pb_nav/_mixins.scss +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef5b8148534fcbf48ac52ba770e58098903388c1dc4ce464942e24f8040e3c8b
|
4
|
+
data.tar.gz: 1d531d6e7d387766082aad0cad62919458b6fe29156978dda1bf9a5ac4bf9f55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66f21574ca6d7f574cfdbd5e668e3864406ecf6a0deaa31be8d4d9dbfa46f542080bbad77000f1494341704be10de927cef400d2997d2c0967f61865932c21de
|
7
|
+
data.tar.gz: 54a928e4a732a060712c8c319561b2e73a011959233c04df4c14b15af18de4ebadbf02136dafdf5dc14132a35e8e4121a933d6dc609be1ac494e71538065b5d6
|
@@ -104,7 +104,7 @@ const CollapsibleMain = ({
|
|
104
104
|
}
|
105
105
|
|
106
106
|
return (
|
107
|
-
<div className={classnames(mainCSS,
|
107
|
+
<div className={classnames(mainCSS, mainSpacing, className)}>
|
108
108
|
<div onClick={handleCollapsibleClick}>
|
109
109
|
<Flex
|
110
110
|
spacing="between"
|
@@ -1,16 +1,26 @@
|
|
1
1
|
/* eslint-disable no-console */
|
2
2
|
import React from 'react'
|
3
|
-
import moment from 'moment'
|
4
3
|
import { fireEvent, render, screen, waitFor, within } from '../utilities/test-utils'
|
5
4
|
|
6
5
|
import DatePicker from './_date_picker'
|
6
|
+
import DateTime from "../pb_kit/dateTime.ts"
|
7
7
|
import { getTimezoneText } from './plugins/timeSelect'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
9
|
jest.setSystemTime(new Date('01/01/2020'));
|
12
10
|
const DEFAULT_DATE = new Date()
|
13
11
|
|
12
|
+
const formatDate = (date) => {
|
13
|
+
const month = (date.getMonth() + 1).toString().padStart(2, "0")
|
14
|
+
const day = (date.getDate()).toString().padStart(2, "0")
|
15
|
+
const year = date.getFullYear()
|
16
|
+
|
17
|
+
return `${month}/${day}/${year}`
|
18
|
+
}
|
19
|
+
|
20
|
+
Date.prototype.formatDate = function () {
|
21
|
+
return formatDate(this)
|
22
|
+
}
|
23
|
+
|
14
24
|
describe('DatePicker Kit', () => {
|
15
25
|
beforeEach(() => {
|
16
26
|
jest.spyOn(console, 'error').mockImplementation(() => { });
|
@@ -158,6 +168,7 @@ describe('DatePicker Kit', () => {
|
|
158
168
|
expect(input).toHaveValue('01/01/2020 at 12:00 PM')
|
159
169
|
})
|
160
170
|
})
|
171
|
+
|
161
172
|
test('shows DatePicker QuickPick dropdown and adds correct date to input', async () => {
|
162
173
|
const testId = 'datepicker-quick-pick'
|
163
174
|
render(
|
@@ -197,10 +208,10 @@ describe('DatePicker Kit', () => {
|
|
197
208
|
)
|
198
209
|
|
199
210
|
await waitFor(() => {
|
200
|
-
expect(input).toHaveValue(
|
211
|
+
expect(input).toHaveValue(DateTime.getYearStartDate(new Date()).formatDate() + " to " + DateTime.getYearEndDate(new Date()).formatDate())
|
201
212
|
})
|
202
|
-
|
203
213
|
})
|
214
|
+
|
204
215
|
test('shows DatePicker QuickPick ranges ending today', async () => {
|
205
216
|
const testId = 'datepicker-quick-pick-ends-today'
|
206
217
|
render(
|
@@ -225,7 +236,7 @@ describe('DatePicker Kit', () => {
|
|
225
236
|
cancelable: true,
|
226
237
|
}),
|
227
238
|
)
|
228
|
-
|
239
|
+
|
229
240
|
const thisYear = within(kit).getByText('This year')
|
230
241
|
|
231
242
|
fireEvent(
|
@@ -237,8 +248,7 @@ describe('DatePicker Kit', () => {
|
|
237
248
|
)
|
238
249
|
|
239
250
|
await waitFor(() => {
|
240
|
-
expect(input).toHaveValue(
|
251
|
+
expect(input).toHaveValue(DateTime.getYearStartDate(new Date()).formatDate() + " to " + new Date().formatDate())
|
241
252
|
})
|
242
|
-
|
243
253
|
})
|
244
254
|
})
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import DateTime from '../../pb_kit/dateTime';
|
2
2
|
|
3
3
|
type FpTypes = {
|
4
4
|
setDate: (arg0: any, arg1: boolean) => void,
|
@@ -23,37 +23,44 @@ let activeLabel = ""
|
|
23
23
|
|
24
24
|
const quickPickPlugin = (thisRangesEndToday: boolean) => {
|
25
25
|
return function (fp: FpTypes & any): any {
|
26
|
-
const
|
27
|
-
const
|
28
|
-
|
29
|
-
const
|
26
|
+
const today = new Date()
|
27
|
+
const yesterday = DateTime.getYesterdayDate(new Date())
|
28
|
+
|
29
|
+
const thisWeekStartDate = DateTime.getFirstDayOfWeek(new Date())
|
30
|
+
const thisWeekEndDate = thisRangesEndToday ? new Date() : DateTime.getLastDayOfWeek(new Date())
|
31
|
+
const lastWeekStartDate = DateTime.getPreviousWeekStartDate(new Date())
|
32
|
+
const lastWeekEndDate = DateTime.getPreviousWeekEndDate(new Date())
|
33
|
+
|
34
|
+
const thisMonthStartDate = DateTime.getMonthStartDate(new Date())
|
35
|
+
const thisMonthEndDate = thisRangesEndToday ? new Date() : DateTime.getMonthEndDate(new Date())
|
36
|
+
const lastMonthStartDate = DateTime.getPreviousMonthStartDate(new Date())
|
37
|
+
const lastMonthEndDate = DateTime.getPreviousMonthEndDate(new Date())
|
38
|
+
|
39
|
+
const thisQuarterStartDate = DateTime.getQuarterStartDate(new Date())
|
40
|
+
const thisQuarterEndDate = thisRangesEndToday ? new Date() : DateTime.getQuarterEndDate(new Date())
|
41
|
+
const lastQuarterStartDate = DateTime.getPreviousQuarterStartDate(new Date())
|
42
|
+
const lastQuarterEndDate = DateTime.getPreviousQuarterEndDate(new Date())
|
43
|
+
|
44
|
+
const thisYearStartDate = DateTime.getYearStartDate(new Date())
|
45
|
+
const thisYearEndDate = thisRangesEndToday ? new Date() : DateTime.getYearEndDate(new Date())
|
46
|
+
const lastYearStartDate = DateTime.getPreviousYearStartDate(new Date())
|
47
|
+
const lastYearEndDate = DateTime.getPreviousYearEndDate(new Date())
|
30
48
|
|
31
49
|
// variable that holds the ranges available
|
32
50
|
const ranges = {
|
33
|
-
'Today': [
|
34
|
-
'Yesterday': [
|
35
|
-
'This week': [
|
36
|
-
'This month': [
|
37
|
-
'This quarter': [
|
38
|
-
'This year': [
|
39
|
-
'Last week': [
|
40
|
-
|
41
|
-
|
42
|
-
]
|
43
|
-
'Last month': [
|
44
|
-
moment().subtract(1, 'month').startOf('month').toDate(),
|
45
|
-
moment().subtract(1, 'month').endOf('month').toDate()
|
46
|
-
],
|
47
|
-
'Last quarter': [
|
48
|
-
moment().subtract(1, 'quarter').startOf('quarter').toDate(),
|
49
|
-
moment().subtract(1, 'quarter').endOf('quarter').toDate()
|
50
|
-
],
|
51
|
-
'Last year': [
|
52
|
-
moment().subtract(1, 'year').startOf('year').toDate(),
|
53
|
-
moment().subtract(1, 'year').endOf('year').toDate()
|
54
|
-
]
|
51
|
+
'Today': [today, today],
|
52
|
+
'Yesterday': [yesterday, yesterday],
|
53
|
+
'This week': [thisWeekStartDate, thisWeekEndDate],
|
54
|
+
'This month': [thisMonthStartDate, thisMonthEndDate],
|
55
|
+
'This quarter': [thisQuarterStartDate, thisQuarterEndDate],
|
56
|
+
'This year': [thisYearStartDate, thisYearEndDate],
|
57
|
+
'Last week': [lastWeekStartDate, lastWeekEndDate],
|
58
|
+
'Last month': [lastMonthStartDate, lastMonthEndDate],
|
59
|
+
'Last quarter': [lastQuarterStartDate, lastQuarterEndDate],
|
60
|
+
'Last year': [lastYearStartDate, lastYearEndDate]
|
55
61
|
}
|
56
|
-
|
62
|
+
|
63
|
+
// creating the ul element for the nav dropdown and giving it classnames
|
57
64
|
const rangesNav = document.createElement('ul');
|
58
65
|
|
59
66
|
// creating the pluginData object that will hold the properties of this plugin
|
@@ -64,11 +71,11 @@ const quickPickPlugin = (thisRangesEndToday: boolean) => {
|
|
64
71
|
};
|
65
72
|
|
66
73
|
/**
|
67
|
-
|
68
|
-
|
69
|
-
|
74
|
+
* @param {string} label
|
75
|
+
* @returns HTML Element
|
76
|
+
*/
|
70
77
|
|
71
|
-
//function for creating the range buttons in the nav
|
78
|
+
// function for creating the range buttons in the nav
|
72
79
|
const addRangeButton = (label: string) => {
|
73
80
|
|
74
81
|
// creating new elements to mimick selectable card component
|
@@ -88,7 +95,7 @@ const quickPickPlugin = (thisRangesEndToday: boolean) => {
|
|
88
95
|
// append the li item to the ul rangeNav prop
|
89
96
|
pluginData.rangesNav.appendChild(item);
|
90
97
|
|
91
|
-
// return the ranges
|
98
|
+
// return the ranges button prop
|
92
99
|
return pluginData.rangesButtons[label];
|
93
100
|
};
|
94
101
|
|
@@ -98,7 +105,7 @@ const quickPickPlugin = (thisRangesEndToday: boolean) => {
|
|
98
105
|
if (current) {
|
99
106
|
current.classList.remove('active');
|
100
107
|
}
|
101
|
-
|
108
|
+
|
102
109
|
if (selectedDates.length > 0 && activeLabel) {
|
103
110
|
pluginData.rangesButtons[activeLabel].classList.add('active');
|
104
111
|
}
|
@@ -109,16 +116,15 @@ const quickPickPlugin = (thisRangesEndToday: boolean) => {
|
|
109
116
|
selectedDates[1].toDateString() === pluginData.ranges[activeLabel][1].toDateString()
|
110
117
|
}
|
111
118
|
|
112
|
-
|
113
119
|
return {
|
114
|
-
// onReady is a hook from flatpickr that runs when
|
120
|
+
// onReady is a hook from flatpickr that runs when calendar is in a ready state
|
115
121
|
onReady(selectedDates: Array<Date>) {
|
116
122
|
// loop through the ranges and create an anchor tag for each range and add an event listener to set the date when user clicks on a date range
|
117
123
|
for (const [label, range] of Object.entries(pluginData.ranges)) {
|
118
124
|
addRangeButton(label).addEventListener('click', function () {
|
119
125
|
|
120
|
-
const start =
|
121
|
-
const end =
|
126
|
+
const start = new Date(range[0]);
|
127
|
+
const end = new Date(range[1]);
|
122
128
|
|
123
129
|
if (!start) {
|
124
130
|
fp.clear();
|
@@ -170,4 +176,4 @@ const quickPickPlugin = (thisRangesEndToday: boolean) => {
|
|
170
176
|
};
|
171
177
|
}
|
172
178
|
|
173
|
-
export default quickPickPlugin;
|
179
|
+
export default quickPickPlugin;
|
@@ -116,7 +116,6 @@ export const toIso = (newDate: Date | string): string => {
|
|
116
116
|
}
|
117
117
|
|
118
118
|
export const fromNow = (newDate: Date | string): string => {
|
119
|
-
|
120
119
|
const startDate = formatDate(newDate).getTime()
|
121
120
|
const endDate = new Date().getTime()
|
122
121
|
const elapsedTime = endDate - startDate
|
@@ -154,6 +153,193 @@ export const toCustomFormat = (newDate: Date | string, format = 'month_day'): st
|
|
154
153
|
}
|
155
154
|
}
|
156
155
|
|
156
|
+
// For quickPick.tsx
|
157
|
+
// Yesterday
|
158
|
+
export const getYesterdayDate = (newDate: Date | string): Date => {
|
159
|
+
const today = formatDate(newDate)
|
160
|
+
const yesterday = new Date()
|
161
|
+
yesterday.setDate(today.getDate() - 1)
|
162
|
+
|
163
|
+
return yesterday
|
164
|
+
}
|
165
|
+
|
166
|
+
// Weeks
|
167
|
+
export const getFirstDayOfWeek = (newDate: Date | string): Date => {
|
168
|
+
const today = formatDate(newDate)
|
169
|
+
const dayOfWeek = today.getDay()
|
170
|
+
// Replicate Moment.js: Start of week (Monday) has a time of 00:00:00
|
171
|
+
const firstDayOfWeek = new Date(today.setHours(0, 0, 0))
|
172
|
+
const isSunday = dayOfWeek === 0
|
173
|
+
|
174
|
+
const daysToSubtract = isSunday ? 6 : (dayOfWeek - 1)
|
175
|
+
firstDayOfWeek.setDate(today.getDate() - daysToSubtract)
|
176
|
+
|
177
|
+
return firstDayOfWeek
|
178
|
+
}
|
179
|
+
|
180
|
+
export const getLastDayOfWeek = (newDate: Date | string): Date => {
|
181
|
+
const today = formatDate(newDate)
|
182
|
+
const dayOfWeek = today.getDay()
|
183
|
+
// Replicate Moment.js: End of week (Sunday) has a time of 23:59:59
|
184
|
+
const lastDayOfWeek = new Date(today.setHours(23, 59, 59, 0))
|
185
|
+
const isSunday = dayOfWeek === 0
|
186
|
+
|
187
|
+
const daysToAdd = isSunday ? 0 : (7 - dayOfWeek)
|
188
|
+
lastDayOfWeek.setDate(today.getDate() + daysToAdd)
|
189
|
+
|
190
|
+
return lastDayOfWeek
|
191
|
+
}
|
192
|
+
|
193
|
+
export const getPreviousWeekStartDate = (newDate: Date | string): Date => {
|
194
|
+
const firstDayOfWeek = getFirstDayOfWeek(newDate)
|
195
|
+
const firstDayOfPreviousWeek = new Date(
|
196
|
+
firstDayOfWeek.getFullYear(),
|
197
|
+
firstDayOfWeek.getMonth(),
|
198
|
+
firstDayOfWeek.getDate() - 7
|
199
|
+
)
|
200
|
+
|
201
|
+
return firstDayOfPreviousWeek
|
202
|
+
}
|
203
|
+
|
204
|
+
export const getPreviousWeekEndDate = (newDate: Date | string): Date => {
|
205
|
+
const lastDayOfWeek = getLastDayOfWeek(newDate)
|
206
|
+
const lastDayOfPreviousWeek = new Date(
|
207
|
+
lastDayOfWeek.getFullYear(),
|
208
|
+
lastDayOfWeek.getMonth(),
|
209
|
+
lastDayOfWeek.getDate() - 7,
|
210
|
+
lastDayOfWeek.getHours(),
|
211
|
+
lastDayOfWeek.getMinutes(),
|
212
|
+
lastDayOfWeek.getSeconds()
|
213
|
+
)
|
214
|
+
|
215
|
+
return lastDayOfPreviousWeek
|
216
|
+
}
|
217
|
+
|
218
|
+
// Months
|
219
|
+
export const getMonthStartDate = (newDate: Date | string): Date => {
|
220
|
+
const date = formatDate(newDate)
|
221
|
+
const firstDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1)
|
222
|
+
|
223
|
+
return firstDayOfMonth
|
224
|
+
}
|
225
|
+
|
226
|
+
export const getMonthEndDate = (newDate: Date | string): Date => {
|
227
|
+
const date = formatDate(newDate)
|
228
|
+
// Replicate Moment.js: End of month has a time of 23:59:59
|
229
|
+
const lastDayOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0, 23, 59, 59)
|
230
|
+
|
231
|
+
return lastDayOfMonth
|
232
|
+
}
|
233
|
+
|
234
|
+
export const getPreviousMonthStartDate = (newDate: Date | string): Date => {
|
235
|
+
const firstDayOfMonth = getMonthStartDate(newDate)
|
236
|
+
const firstDayOfPreviousMonth = new Date(
|
237
|
+
firstDayOfMonth.getFullYear(),
|
238
|
+
firstDayOfMonth.getMonth() - 1,
|
239
|
+
firstDayOfMonth.getDate()
|
240
|
+
)
|
241
|
+
|
242
|
+
return firstDayOfPreviousMonth
|
243
|
+
}
|
244
|
+
|
245
|
+
export const getPreviousMonthEndDate = (newDate: Date | string): Date => {
|
246
|
+
const lastDayOfMonth = getMonthEndDate(newDate)
|
247
|
+
const lastDayOfPreviousMonth = new Date(
|
248
|
+
lastDayOfMonth.getFullYear(),
|
249
|
+
lastDayOfMonth.getMonth() - 1,
|
250
|
+
lastDayOfMonth.getDate(),
|
251
|
+
lastDayOfMonth.getHours(),
|
252
|
+
lastDayOfMonth.getMinutes(),
|
253
|
+
lastDayOfMonth.getSeconds()
|
254
|
+
)
|
255
|
+
|
256
|
+
return lastDayOfPreviousMonth
|
257
|
+
}
|
258
|
+
|
259
|
+
// Quarters
|
260
|
+
export const getQuarterStartDate = (newDate: Date | string): Date => {
|
261
|
+
const date = formatDate(newDate)
|
262
|
+
const quarter = Math.floor(date.getMonth() / 3)
|
263
|
+
const startOfQuarter = new Date(date.getFullYear(), quarter * 3, 1)
|
264
|
+
|
265
|
+
return startOfQuarter
|
266
|
+
}
|
267
|
+
|
268
|
+
export const getQuarterEndDate = (newDate: Date | string): Date => {
|
269
|
+
const date = formatDate(newDate)
|
270
|
+
const quarter = Math.floor(date.getMonth() / 3)
|
271
|
+
const startOfNextQuarter = new Date(date.getFullYear(), (quarter + 1) * 3, 1)
|
272
|
+
// Replicate Moment.js: End of quarter has a time of 23:59:59
|
273
|
+
const endOfQuarter = new Date(startOfNextQuarter.getTime() - 1)
|
274
|
+
|
275
|
+
return endOfQuarter
|
276
|
+
}
|
277
|
+
|
278
|
+
export const getPreviousQuarterStartDate = (newDate: Date | string): Date => {
|
279
|
+
const startOfQuarter = getQuarterStartDate(newDate)
|
280
|
+
const firstDayOfPreviousQuarter = new Date(
|
281
|
+
startOfQuarter.getFullYear(),
|
282
|
+
startOfQuarter.getMonth() - 3,
|
283
|
+
startOfQuarter.getDate()
|
284
|
+
)
|
285
|
+
|
286
|
+
return firstDayOfPreviousQuarter
|
287
|
+
}
|
288
|
+
|
289
|
+
export const getPreviousQuarterEndDate = (newDate: Date | string): Date => {
|
290
|
+
const endOfQuarter = getQuarterEndDate(newDate)
|
291
|
+
const lastDayOfPreviousQuarter = new Date(
|
292
|
+
endOfQuarter.getFullYear(),
|
293
|
+
endOfQuarter.getMonth() - 3,
|
294
|
+
endOfQuarter.getDate(),
|
295
|
+
endOfQuarter.getHours(),
|
296
|
+
endOfQuarter.getMinutes(),
|
297
|
+
endOfQuarter.getSeconds()
|
298
|
+
)
|
299
|
+
|
300
|
+
return lastDayOfPreviousQuarter
|
301
|
+
}
|
302
|
+
|
303
|
+
// Years
|
304
|
+
export const getYearStartDate = (newDate: Date | string): Date => {
|
305
|
+
const date = formatDate(newDate)
|
306
|
+
const startOfYear = new Date(date.getFullYear(), 0, 1)
|
307
|
+
|
308
|
+
return startOfYear
|
309
|
+
}
|
310
|
+
|
311
|
+
export const getYearEndDate = (newDate: Date | string): Date => {
|
312
|
+
const date = formatDate(newDate)
|
313
|
+
const endOfYear = new Date(date.getFullYear(), 11, 31, 23, 59, 59)
|
314
|
+
|
315
|
+
return endOfYear
|
316
|
+
}
|
317
|
+
|
318
|
+
export const getPreviousYearStartDate = (newDate: Date | string): Date => {
|
319
|
+
const startOfYear = getYearStartDate(newDate)
|
320
|
+
const firstDayOfPreviousYear = new Date(
|
321
|
+
startOfYear.getFullYear() - 1,
|
322
|
+
startOfYear.getMonth(),
|
323
|
+
startOfYear.getDate()
|
324
|
+
)
|
325
|
+
|
326
|
+
return firstDayOfPreviousYear
|
327
|
+
}
|
328
|
+
|
329
|
+
export const getPreviousYearEndDate = (newDate: Date | string): Date => {
|
330
|
+
const endOfYear = getYearEndDate(newDate)
|
331
|
+
const lastDayOfPreviousYear = new Date(
|
332
|
+
endOfYear.getFullYear() - 1,
|
333
|
+
endOfYear.getMonth(),
|
334
|
+
endOfYear.getDate(),
|
335
|
+
endOfYear.getHours(),
|
336
|
+
endOfYear.getMinutes(),
|
337
|
+
endOfYear.getSeconds()
|
338
|
+
)
|
339
|
+
|
340
|
+
return lastDayOfPreviousYear
|
341
|
+
}
|
342
|
+
|
157
343
|
export default {
|
158
344
|
toMinute,
|
159
345
|
toHour,
|
@@ -170,4 +356,21 @@ export default {
|
|
170
356
|
toIso,
|
171
357
|
fromNow,
|
172
358
|
toCustomFormat,
|
359
|
+
getYesterdayDate,
|
360
|
+
getFirstDayOfWeek,
|
361
|
+
getLastDayOfWeek,
|
362
|
+
getPreviousWeekStartDate,
|
363
|
+
getPreviousWeekEndDate,
|
364
|
+
getMonthStartDate,
|
365
|
+
getMonthEndDate,
|
366
|
+
getPreviousMonthStartDate,
|
367
|
+
getPreviousMonthEndDate,
|
368
|
+
getQuarterStartDate,
|
369
|
+
getQuarterEndDate,
|
370
|
+
getPreviousQuarterStartDate,
|
371
|
+
getPreviousQuarterEndDate,
|
372
|
+
getYearStartDate,
|
373
|
+
getYearEndDate,
|
374
|
+
getPreviousYearStartDate,
|
375
|
+
getPreviousYearEndDate
|
173
376
|
}
|
@@ -1,22 +1,24 @@
|
|
1
1
|
@mixin bold {
|
2
2
|
@include subtle;
|
3
3
|
|
4
|
-
[class*=pb_nav_list_kit_item]
|
5
|
-
&[class*=
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
[class*=pb_nav_list_kit_item][class*=pb_nav_list_item]{
|
5
|
+
&[class*=_link] {
|
6
|
+
&[class*=_active] {
|
7
|
+
background-color: $primary;
|
8
|
+
color: $white;
|
9
|
+
box-shadow: $shadow_deep;
|
10
|
+
@media (hover:hover) {
|
11
|
+
&:hover {
|
12
|
+
background-color: darken($primary, 4%);
|
13
|
+
[class*=_text],[class*=_icon] {
|
14
|
+
color: $white;
|
15
|
+
}
|
14
16
|
}
|
15
17
|
}
|
18
|
+
[class*=_text],[class*=_icon] {
|
19
|
+
font-weight: $bolder;
|
20
|
+
}
|
16
21
|
}
|
17
|
-
|
18
|
-
font-weight: $bolder;
|
19
|
-
}
|
20
|
-
}
|
22
|
+
}
|
21
23
|
}
|
22
24
|
}
|