import _extends from"babel-runtime/helpers/extends";import moment from"moment";var defaultDisabledTime={disabledHours:function(){return[]},disabledMinutes:function(){return[]},disabledSeconds:function(){return[]}};export function getTodayTime(e){var t=moment();return t.locale(e.locale()).utcOffset(e.utcOffset()),t};export function getTitleString(e){return e.format("LL")};export function getTodayTimeStr(e){return getTitleString(getTodayTime(e))};export function getMonthName(e){var t=e.locale();return e.localeData()["zh-cn"===t?"months":"monthsShort"](e)};export function syncTime(e,t){moment.isMoment(e)&&moment.isMoment(t)&&(t.hour(e.hour()),t.minute(e.minute()),t.second(e.second()))};export function getTimeConfig(e,t){var n=t?t(e):{};return n=_extends({},defaultDisabledTime,n)};export function isTimeValidByConfig(e,t){var n=!1;if(e){var i=e.hour(),o=e.minute(),r=e.second();if(-1===t.disabledHours().indexOf(i))if(-1===t.disabledMinutes(i).indexOf(o))n=-1!==t.disabledSeconds(i,o).indexOf(r);else n=!0;else n=!0}return!n};export function isTimeValid(e,t){return isTimeValidByConfig(e,getTimeConfig(e,t))};export function isAllowedDate(e,t,n){return(!t||!t(e))&&!(n&&!isTimeValid(e,n))};