Skip to content

Commit c8cc023

Browse files
committed
Rerun prettier on *.js
1 parent 467b990 commit c8cc023

File tree

3 files changed

+46
-24
lines changed

3 files changed

+46
-24
lines changed

src/date_utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,17 +246,17 @@ export function equals(date1, date2) {
246246

247247
export function isSameYear(date1, date2) {
248248
if (date1 && date2) {
249-
return date1.isSame(date2, "year");
249+
return date1.isSame(date2, "year");
250250
} else {
251-
return !date1 && !date2;
251+
return !date1 && !date2;
252252
}
253253
}
254254

255255
export function isSameMonth(date1, date2) {
256256
if (date1 && date2) {
257-
return date1.isSame(date2, "month");
257+
return date1.isSame(date2, "month");
258258
} else {
259-
return !date1 && !date2;
259+
return !date1 && !date2;
260260
}
261261
}
262262

test/calendar_test.js

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ describe("Calendar", function() {
159159
expect(yearReadView).to.have.length(1);
160160
});
161161

162-
163162
it("should show only one year dropdown menu if toggled on and multiple month mode on", function() {
164163
const calendar = getCalendar({ showYearDropdown: true, monthsShown: 2 });
165164
const monthReadView = calendar.find(YearDropdown);
@@ -236,7 +235,6 @@ describe("Calendar", function() {
236235
});
237236

238237
it("when clicking disabled month navigation, should not change month", function() {
239-
240238
const calendar = getCalendar({
241239
minDate: utils.newDate(),
242240
maxDate: utils.newDate(),
@@ -267,7 +265,6 @@ describe("Calendar", function() {
267265
});
268266

269267
it("when clicking non-disabled month navigation, should change month", function() {
270-
271268
const calendar = getCalendar({
272269
selected: utils.newDate(),
273270
minDate: utils.subtractMonths(utils.newDate(), 3),
@@ -293,7 +290,6 @@ describe("Calendar", function() {
293290
});
294291
});
295292

296-
297293
it("should not show the month dropdown menu by default", function() {
298294
const calendar = getCalendar();
299295
const monthReadView = calendar.find(MonthDropdown);
@@ -319,24 +315,26 @@ describe("Calendar", function() {
319315
});
320316

321317
it("should show the month-year dropdown menu if toggled on", function() {
322-
const calendar = getCalendar({ showMonthYearDropdown: true,
323-
minDate: utils.subtractYears(utils.newDate(), 1),
324-
maxDate: utils.addYears(utils.newDate(), 1) });
318+
const calendar = getCalendar({
319+
showMonthYearDropdown: true,
320+
minDate: utils.subtractYears(utils.newDate(), 1),
321+
maxDate: utils.addYears(utils.newDate(), 1)
322+
});
325323
const monthYearReadView = calendar.find(MonthYearDropdown);
326324
expect(monthYearReadView).to.have.length(1);
327325
});
328326

329-
330327
it("should show only one month-year dropdown menu if toggled on and multiple month mode on", function() {
331-
const calendar = getCalendar({ showMonthYearDropdown: true,
332-
minDate: utils.subtractYears(utils.newDate(), 1),
333-
maxDate: utils.addYears(utils.newDate(), 1),
334-
monthsShown: 2 });
328+
const calendar = getCalendar({
329+
showMonthYearDropdown: true,
330+
minDate: utils.subtractYears(utils.newDate(), 1),
331+
maxDate: utils.addYears(utils.newDate(), 1),
332+
monthsShown: 2
333+
});
335334
const monthReadView = calendar.find(MonthYearDropdown);
336335
expect(monthReadView).to.have.length(1);
337336
});
338337

339-
340338
it("should not show the today button by default", function() {
341339
const calendar = getCalendar();
342340
const todayButton = calendar.find(".react-datepicker__today-button");
@@ -616,17 +614,28 @@ describe("Calendar", function() {
616614
});
617615

618616
it("calls onYearChange prop when selection is changed from month-year dropdown", () => {
619-
const option = calendar.find(MonthYearDropdown).find("select").find("option").at(3);
617+
const option = calendar
618+
.find(MonthYearDropdown)
619+
.find("select")
620+
.find("option")
621+
.at(3);
620622
option.simulate("change");
621623

622624
assert(onYearChangeSpy.called === true, "onYearChange should be called");
623625
});
624626

625627
it("calls onMonthChange prop when selection is changed from month-year dropdown", () => {
626-
const option = calendar.find(MonthYearDropdown).find("select").find("option").at(3);
628+
const option = calendar
629+
.find(MonthYearDropdown)
630+
.find("select")
631+
.find("option")
632+
.at(3);
627633
option.simulate("change");
628634

629-
assert(onMonthChangeSpy.called === true, "onMonthChange should be called");
635+
assert(
636+
onMonthChangeSpy.called === true,
637+
"onMonthChange should be called"
638+
);
630639
});
631640
});
632641

test/month_dropdown_test.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,24 @@ describe("MonthDropdown", () => {
162162
});
163163
// Short Month Names
164164
it("renders month options with short name and default locale", () => {
165-
monthDropdown = getMonthDropdown({dropdownMode: "select", useShortMonthInDropdown: true})
166-
var options = monthDropdown.find("option")
165+
monthDropdown = getMonthDropdown({
166+
dropdownMode: "select",
167+
useShortMonthInDropdown: true
168+
});
169+
var options = monthDropdown.find("option");
167170
expect(options.map(o => o.text())).to.eql([
168-
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
169-
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
171+
"Jan",
172+
"Feb",
173+
"Mar",
174+
"Apr",
175+
"May",
176+
"Jun",
177+
"Jul",
178+
"Aug",
179+
"Sep",
180+
"Oct",
181+
"Nov",
182+
"Dec"
170183
]);
171184
});
172185

0 commit comments

Comments
 (0)