import { State } from '../../types/store' ; import { GetDateType } from '../../types/core' ; import { getFormatDate } from './format' ; import { has } from '../../utils/typeOf' ; import { date } from '../../utils/date' ; export function getDate ( state ) { const isRange = has ( state . type , 'range' ) ; const [ startDate , endDate ] = [ date ( state . start . date ) , date ( state . end . date ) ] ; if ( isRange ) { return [ startDate , endDate ] ; } else { return startDate ; } } export function destroyHook ( state ) { const { popover } = state ; if ( ! popover ) return ; const parent = popover . parentNode ; if ( parent && parent . removeChild ) { parent . removeChild ( popover ) ; } }