Skip to content

Commit

Permalink
4.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jajugoguma committed Aug 12, 2021
1 parent 81b69ee commit 2cb6ec6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
8 changes: 7 additions & 1 deletion dist/tui-date-picker.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* TOAST UI Date Picker
* @version 4.2.2
* @version 4.3.0
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
* @license MIT
*/
Expand Down Expand Up @@ -97,6 +97,12 @@
background-color: #f4f4f4
}

.tui-calendar .tui-calendar-title-today:hover {
color: #333;
background-color: #edf4fc;
cursor: pointer;
}

.tui-calendar .tui-calendar-title {
display: inline-block;
font-size: 18px;
Expand Down
18 changes: 17 additions & 1 deletion dist/tui-date-picker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* TOAST UI Date Picker
* @version 4.2.2
* @version 4.3.0
* @author NHN. FE Development Lab <dl_javascript@nhn.com>
* @license MIT
*/
Expand Down Expand Up @@ -218,6 +218,7 @@ module.exports = {
CLASS_NAME_PREV_YEAR_BTN: 'tui-calendar-btn-prev-year',
CLASS_NAME_NEXT_YEAR_BTN: 'tui-calendar-btn-next-year',
CLASS_NAME_NEXT_MONTH_BTN: 'tui-calendar-btn-next-month',
CLASS_NAME_TITLE_TODAY: 'tui-calendar-title-today',

DEFAULT_WEEK_START_DAY: 'Sun',
WEEK_START_DAY_MAP: {
Expand Down Expand Up @@ -2671,6 +2672,7 @@ var DatePicker = defineClass(
_setEvents: function() {
mouseTouchEvent.on(this._element, 'click', this._onClickHandler, this);
this._calendar.on('draw', this._onDrawCalendar, this);
this._calendar._header.on('today', this._onClickTodayHandler, this);
},

/**
Expand Down Expand Up @@ -2976,6 +2978,16 @@ var DatePicker = defineClass(
}
},

/**
* Event handler for click of today text
* @param {Event} ev An event object
* @private
*/
_onClickTodayHandler: function() {
this.setDate(Date.now());
this.close();
},

/**
* Update date from event-target
* @param {HTMLElement} target An event target element
Expand Down Expand Up @@ -5481,6 +5493,8 @@ var SELECTOR_INNER_ELEM = '.tui-calendar-header-inner';
var SELECTOR_INFO_ELEM = '.tui-calendar-header-info';
var SELECTOR_BTN = '.tui-calendar-btn';

var TODAY_TITLE_ELEM = '.tui-calendar-title-today';

var YEAR_TITLE_FORMAT = 'yyyy';

/**
Expand Down Expand Up @@ -5594,6 +5608,8 @@ var Header = defineClass(

if (closest(target, SELECTOR_BTN)) {
this.fire('click', ev);
} else if (closest(target, TODAY_TITLE_ELEM)) {
this.fire('today');
}
},

Expand Down
Loading

0 comments on commit 2cb6ec6

Please sign in to comment.