Skip to content

Commit 875ab98

Browse files
committed
Merge pull request dangrossman#216 from IjinPL/master
Fixed setting custom locale
2 parents 519cbc1 + d29535c commit 875ab98

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

daterangepicker.js

+28-4
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
if (typeof options.applyClass == 'string')
170170
this.applyClass = options.applyClass;
171171

172-
if (typeof options.cancelClass == 'string')
172+
if (typeof options.cancelClass == 'string')
173173
this.cancelClass = options.cancelClass;
174174

175175
if (typeof options.ranges == 'object') {
@@ -227,6 +227,30 @@
227227
iterator--;
228228
}
229229
}
230+
231+
if (typeof options.locale.applyLabel == 'string') {
232+
this.locale.applyLabel = options.locale.applyLabel;
233+
}
234+
235+
if (typeof options.locale.cancelLabel == 'string') {
236+
this.locale.cancelLabel = options.locale.cancelLabel;
237+
}
238+
239+
if (typeof options.locale.fromLabel == 'string') {
240+
this.locale.fromLabel = options.locale.fromLabel;
241+
}
242+
243+
if (typeof options.locale.toLabel == 'string') {
244+
this.locale.toLabel = options.locale.toLabel;
245+
}
246+
247+
if (typeof options.locale.weekLabel == 'string') {
248+
this.locale.weekLabel = options.locale.weekLabel;
249+
}
250+
251+
if (typeof options.locale.customRangeLabel == 'string') {
252+
this.locale.customRangeLabel = options.locale.customRangeLabel;
253+
}
230254
}
231255

232256
if (typeof options.opens == 'string')
@@ -347,10 +371,10 @@
347371
if (!this.timePicker)
348372
this.startDate = this.startDate.startOf('day');
349373

350-
this.oldStartDate = this.startDate.clone();
374+
this.oldStartDate = this.startDate.clone();
351375

352376
this.updateView();
353-
this.updateCalendars();
377+
this.updateCalendars();
354378
},
355379

356380
setEndDate: function(endDate) {
@@ -363,7 +387,7 @@
363387
if (!this.timePicker)
364388
this.endDate = this.endDate.startOf('day');
365389

366-
this.endDate = this.endDate.clone();
390+
this.endDate = this.endDate.clone();
367391

368392
this.updateView();
369393
this.updateCalendars();

0 commit comments

Comments
 (0)