Skip to content

Commit 281a1fb

Browse files
picking the correct dash is a very, very big deal
1 parent 41ffdb3 commit 281a1fb

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

src/components/DatePicker/Common.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const DateRangePickerInput = ({
103103
if (selectedEndDate) {
104104
formattedValue = (
105105
<span>
106-
{selectedDateFormatter.format(selectedStartDate)} -{" "}
106+
{selectedDateFormatter.format(selectedStartDate)} {" "}
107107
{selectedDateFormatter.format(selectedEndDate)}
108108
</span>
109109
);
@@ -115,7 +115,7 @@ export const DateRangePickerInput = ({
115115
color="muted"
116116
component="span"
117117
>
118-
- end date
118+
end date
119119
</Text>
120120
</span>
121121
);
@@ -182,7 +182,7 @@ export const DateTimePickerInput = ({
182182
.format(selectedStartDate)
183183
.replace("AM", "am")
184184
.replace("PM", "pm")}{" "}
185-
-{" "}
185+
{" "}
186186
{selectedDateTimeFormatter
187187
.format(selectedEndDate)
188188
.replace("AM", "am")
@@ -197,7 +197,7 @@ export const DateTimePickerInput = ({
197197
.format(selectedStartDate)
198198
.replace("AM", "am")
199199
.replace("PM", "pm")}{" "}
200-
- {selectedDateTimeDateFormatter.format(selectedEndDate)},{" "}
200+
{selectedDateTimeDateFormatter.format(selectedEndDate)},{" "}
201201
<Text
202202
color="muted"
203203
component="span"
@@ -219,7 +219,7 @@ export const DateTimePickerInput = ({
219219
color="muted"
220220
component="span"
221221
>
222-
- end date
222+
end date
223223
</Text>
224224
</span>
225225
);
@@ -238,7 +238,7 @@ export const DateTimePickerInput = ({
238238
component="span"
239239
>
240240
{" "}
241-
- end date
241+
end date
242242
</Text>
243243
</span>
244244
);

src/components/DatePicker/DateRangePicker.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ describe("DateRangePicker", () => {
209209

210210
await userEvent.click(getByTestId("daterangepicker-input"));
211211

212-
expect(getByText("Jul 01, 2020 - Jul 04, 2020")).toBeInTheDocument();
212+
expect(getByText("Jul 01, 2020 Jul 04, 2020")).toBeInTheDocument();
213213
expect(getByText("Jun 2020")).toBeInTheDocument();
214214
expect(getByText("May 2020")).toBeInTheDocument();
215215
expect(getByText("Apr 2020")).toBeInTheDocument();
@@ -315,7 +315,7 @@ describe("DateRangePicker", () => {
315315

316316
await userEvent.click(getByTestId("daterangepicker-input"));
317317

318-
await userEvent.click(getByTestId("Jul 01, 2020 - Jul 04, 2020"));
318+
await userEvent.click(getByTestId("Jul 01, 2020 Jul 04, 2020"));
319319
expect(getByText("Jul 01, 2020 – Jul 04, 2020")).toBeInTheDocument();
320320
});
321321

@@ -374,7 +374,7 @@ describe("DateRangePicker", () => {
374374

375375
await userEvent.click(getByTestId("daterangepicker-input"));
376376

377-
expect(getByText("Mar 01, 2020 - Mar 04, 2020")).toBeInTheDocument();
377+
expect(getByText("Mar 01, 2020 Mar 04, 2020")).toBeInTheDocument();
378378
expect(getByText("Feb 2020")).toBeInTheDocument();
379379
expect(getByText("Jan 2020")).toBeInTheDocument();
380380
expect(getByText("Dec 2019")).toBeInTheDocument();

src/components/DatePicker/DateRangePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ const PredefinedDates = ({
243243
? monthFormatter.format(startDate)
244244
: `${selectedDateFormatter.format(
245245
startDate
246-
)} - ${selectedDateFormatter.format(endDate)}`.trim();
246+
)} ${selectedDateFormatter.format(endDate)}`.trim();
247247

248248
return (
249249
<StyledDropdownItem

src/components/DatePicker/DateTimePicker.test.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe("DateTimePicker", () => {
3030
);
3131

3232
expect(getByTestId("datetimepicker-input").textContent).toBe(
33-
"Jul 04, 00:00 - end date"
33+
"Jul 04, 00:00 end date"
3434
);
3535
});
3636

@@ -47,7 +47,7 @@ describe("DateTimePicker", () => {
4747
);
4848

4949
expect(getByTestId("datetimepicker-input").textContent).toBe(
50-
"Jul 04, 12:00 am - Jul 05, 00:00"
50+
"Jul 04, 12:00 am Jul 05, 00:00"
5151
);
5252
});
5353

@@ -61,7 +61,7 @@ describe("DateTimePicker", () => {
6161
/>
6262
);
6363

64-
expect(getByText("start date - end date")).toBeInTheDocument();
64+
expect(getByText("start date end date")).toBeInTheDocument();
6565
});
6666

6767
describe("selecting dates", () => {
@@ -84,7 +84,7 @@ describe("DateTimePicker", () => {
8484
await userEvent.click(getByText("4"));
8585
await userEvent.click(getByText("4"));
8686

87-
expect(getByText("start date - end date")).toBeInTheDocument();
87+
expect(getByText("start date end date")).toBeInTheDocument();
8888
});
8989

9090
it("calls onSelectDateRange when a date range is selected and passes in the selected date range", async () => {
@@ -118,7 +118,7 @@ describe("DateTimePicker", () => {
118118
await userEvent.click(getByText("10"));
119119

120120
expect(getByTestId("datetimepicker-input").textContent).toBe(
121-
"Jul 10, 00:00 - end date"
121+
"Jul 10, 00:00 end date"
122122
);
123123
});
124124

@@ -142,7 +142,7 @@ describe("DateTimePicker", () => {
142142
await userEvent.click(getByText("4"));
143143

144144
expect(getByTestId("datetimepicker-input").textContent).toBe(
145-
"Jul 04, 00:00 - end date"
145+
"Jul 04, 00:00 end date"
146146
);
147147
});
148148

@@ -159,7 +159,7 @@ describe("DateTimePicker", () => {
159159
await userEvent.click(getByText("01:30 am"));
160160

161161
expect(getByTestId("datetimepicker-input").textContent).toBe(
162-
"Jul 04, 01:30 am - end date"
162+
"Jul 04, 01:30 am end date"
163163
);
164164
});
165165

@@ -176,7 +176,7 @@ describe("DateTimePicker", () => {
176176
await userEvent.click(getByText("11"));
177177

178178
expect(getByTestId("datetimepicker-input").textContent).toBe(
179-
"Jul 04, 01:30 am - Jul 11, 00:00"
179+
"Jul 04, 01:30 am Jul 11, 00:00"
180180
);
181181
});
182182

@@ -194,7 +194,7 @@ describe("DateTimePicker", () => {
194194
await userEvent.click(getByText("02:30 pm"));
195195

196196
expect(getByTestId("datetimepicker-input").textContent).toBe(
197-
"Jul 04, 01:30 am - Jul 11, 02:30 pm"
197+
"Jul 04, 01:30 am Jul 11, 02:30 pm"
198198
);
199199
});
200200
});
@@ -309,7 +309,7 @@ describe("DateTimePicker", () => {
309309
await userEvent.click(getByText("Past 15 minutes"));
310310

311311
expect(getByTestId("datetimepicker-input").textContent).toBe(
312-
"Jul 04, 11:15 am - Jul 04, 11:30 am"
312+
"Jul 04, 11:15 am Jul 04, 11:30 am"
313313
);
314314
});
315315
});

src/components/DatePicker/DateTimePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ export const DateTimePicker = ({
332332
futureStartDatesDisabled = false,
333333
maxRangeLength = -1,
334334
onSelectDateRange,
335-
placeholder = "start date - end date",
335+
placeholder = "start date end date",
336336
predefinedTimesList,
337337
}: DateTimePickerProps) => {
338338
const [isOpen, setIsOpen] = useState<boolean>(false);

0 commit comments

Comments
 (0)