Skip to content

Commit

Permalink
Merge branch 'hotfix/DateDestructuring'
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikiki committed Feb 10, 2018
2 parents 533b1ef + d954e17 commit af0fa58
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dist/bulma-calendar.js
Expand Up @@ -320,13 +320,14 @@ export default class DatePicker {
[].forEach.call(this.datePickerCalendarDays, (calendarDay) => {
calendarDay.addEventListener(this._clickEvent, (e) => {
e.preventDefault();
let date = e.currentTarget.dataset.date.split('-');
let [year, month, day] = date;
if (typeof this.options.onSelect != 'undefined' &&
this.options.onSelect != null &&
this.options.onSelect) {
this.options.onSelect(new Date(year, month, day));
}
let date = e.currentTarget.dataset.date.split('-');
this.element.value = this._getFormatedDate((new Date(date[0], date[1], date[2])), this.options.dateFormat);
this.element.value = this._getFormatedDate((new Date(year, month, day)), this.options.dateFormat);
if (this.options.closeOnSelect) {
this.hide();
}
Expand Down

0 comments on commit af0fa58

Please sign in to comment.