playbook_ui 12.14.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown456 → 12.14.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown457
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f8208a14e5c15e8c393a68f57267ab77dfcb112e76ab6624b323520ee24110f
|
4
|
+
data.tar.gz: 644200e7aba10dfa8636622d05203dd2fa26b74bcee471fd05d848edb53ad428
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ae9ad4954a065d536856caf8f8cfbecb68885dec8674e06dd8f80c7c7abe3e2346cca288aee7792e49165658720d23da9402867d74702157f9024716ae82e08
|
7
|
+
data.tar.gz: 3f88105477044a5db447ac93a924aa43e84112df2bb17a347bb0b372e78bedcaf1723069921aeb4bf359e3552806a48f8fe6cee7c66c895e6016a39c817f31e3
|
@@ -103,65 +103,6 @@ module Playbook
|
|
103
103
|
class_string += error_class
|
104
104
|
class_string
|
105
105
|
end
|
106
|
-
|
107
|
-
def format_date(date)
|
108
|
-
date.strftime("%m/%d/%Y")
|
109
|
-
end
|
110
|
-
|
111
|
-
def date_ranges
|
112
|
-
[
|
113
|
-
{
|
114
|
-
label: "Today",
|
115
|
-
start_date: format_date(::Date.current),
|
116
|
-
end_date: format_date(::Date.current),
|
117
|
-
},
|
118
|
-
{
|
119
|
-
label: "Yesterday",
|
120
|
-
start_date: format_date(::Date.current.yesterday),
|
121
|
-
end_date: format_date(::Date.current.yesterday),
|
122
|
-
},
|
123
|
-
{
|
124
|
-
label: "This Week",
|
125
|
-
start_date: format_date(::Date.current.beginning_of_week),
|
126
|
-
end_date: format_date(::Date.current.end_of_week),
|
127
|
-
},
|
128
|
-
{
|
129
|
-
label: "This Month",
|
130
|
-
start_date: format_date(::Date.current.beginning_of_month),
|
131
|
-
end_date: format_date(::Date.current),
|
132
|
-
},
|
133
|
-
{
|
134
|
-
label: "This Quarter",
|
135
|
-
start_date: format_date(::Date.current.beginning_of_quarter),
|
136
|
-
end_date: format_date(::Date.current),
|
137
|
-
},
|
138
|
-
{
|
139
|
-
label: "This Year",
|
140
|
-
start_date: format_date(::Date.current.beginning_of_year),
|
141
|
-
end_date: format_date(::Date.current),
|
142
|
-
},
|
143
|
-
{
|
144
|
-
label: "Last Week",
|
145
|
-
start_date: format_date(::Date.current.last_week.beginning_of_week),
|
146
|
-
end_date: format_date(::Date.current.last_week.end_of_week),
|
147
|
-
},
|
148
|
-
{
|
149
|
-
label: "Last Month",
|
150
|
-
start_date: format_date(::Date.current.last_month.beginning_of_month),
|
151
|
-
end_date: format_date(::Date.current.last_month.end_of_month),
|
152
|
-
},
|
153
|
-
{
|
154
|
-
label: "Last Quarter",
|
155
|
-
start_date: format_date(::Date.current.last_quarter.beginning_of_quarter),
|
156
|
-
end_date: format_date(::Date.current.last_quarter.end_of_quarter),
|
157
|
-
},
|
158
|
-
{
|
159
|
-
label: "Last Year",
|
160
|
-
start_date: format_date(::Date.current.last_year.beginning_of_year),
|
161
|
-
end_date: format_date(::Date.current.last_year.end_of_year),
|
162
|
-
},
|
163
|
-
]
|
164
|
-
end
|
165
106
|
end
|
166
107
|
end
|
167
108
|
end
|
@@ -158,4 +158,47 @@ describe('DatePicker Kit', () => {
|
|
158
158
|
expect(input).toHaveValue('01/01/2020 at 12:00 PM')
|
159
159
|
})
|
160
160
|
})
|
161
|
+
test('shows DatePicker QuickPick dropdown', async () => {
|
162
|
+
const testId = 'datepicker-quick-pick'
|
163
|
+
render(
|
164
|
+
<DatePicker
|
165
|
+
allowInput
|
166
|
+
data={{ testid: testId }}
|
167
|
+
mode="range"
|
168
|
+
pickerId="date-picker-quick-pick"
|
169
|
+
placeholder="mm/dd/yyyy → mm/dd/yyyy"
|
170
|
+
selectionType="quickpick"
|
171
|
+
/>
|
172
|
+
)
|
173
|
+
|
174
|
+
const kit = screen.getByTestId(testId)
|
175
|
+
const input = within(kit).getByPlaceholderText('mm/dd/yyyy → mm/dd/yyyy')
|
176
|
+
|
177
|
+
fireEvent(
|
178
|
+
input,
|
179
|
+
new MouseEvent('click', {
|
180
|
+
bubbles: true,
|
181
|
+
cancelable: true,
|
182
|
+
}),
|
183
|
+
)
|
184
|
+
const today = within(kit).getByText('Today')
|
185
|
+
const thisYear = within(kit).getByText('This year')
|
186
|
+
await waitFor(() => {
|
187
|
+
expect(today).toBeInTheDocument()
|
188
|
+
expect(thisYear).toBeInTheDocument()
|
189
|
+
})
|
190
|
+
|
191
|
+
fireEvent(
|
192
|
+
thisYear,
|
193
|
+
new MouseEvent('click', {
|
194
|
+
bubbles: true,
|
195
|
+
cancelable: true,
|
196
|
+
}),
|
197
|
+
)
|
198
|
+
|
199
|
+
await waitFor(() => {
|
200
|
+
expect(input).toHaveValue('01/01/2023 → 12/31/2023')
|
201
|
+
})
|
202
|
+
|
203
|
+
})
|
161
204
|
})
|
data/lib/playbook/version.rb
CHANGED
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.14.0.pre.alpha.
|
4
|
+
version: 12.14.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown457
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|