import { addTimeToObj , timeObjToUnixTimestamp , startTimeOfObj , endTimeOfObj , timeObjFromAny , timeObjToUTCOffset , subtractTimeToObj , formatTimeObj , diffTimeObjs , } from './moment' ; import { CalendarIntervalUnit , DateTime , FixedIntervalUnit , Minutes , UnixTimestamp } from './types' ; internal export function addTime ( dateTime , timeZone , unit , count ) { return timeObjToUnixTimestamp ( addTimeToObj ( getTimeObj ( dateTime , timeZone ) , unit , count ) ) ; } internal export function subtractTime ( dateTime , timeZone , unit , count ) { return timeObjToUnixTimestamp ( subtractTimeToObj ( getTimeObj ( dateTime , timeZone ) , unit , count ) ) ; } internal export function getUnixTimestamp ( dateTime , timeZone ? ) { return timeObjToUnixTimestamp ( getTimeObj ( dateTime , timeZone ) ) ; } internal export function startOf ( dateTime , timeZone , unit ) { return timeObjToUnixTimestamp ( startTimeOfObj ( getTimeObj ( dateTime , timeZone ) , unit ) ) ; } internal export function endOf ( dateTime , timeZone , unit ) { return timeObjToUnixTimestamp ( endTimeOfObj ( getTimeObj ( dateTime , timeZone ) , unit ) ) ; } function getTimeObj ( dateTime , timeZone ? ) { return timeObjFromAny ( dateTime , timeZone ) ; } internal export function getUTCOffset ( dateTime , timeZone ? ) { return timeObjToUTCOffset ( getTimeObj ( dateTime , timeZone ) ) ; } internal export function formatTime ( dateTime , timeZone , format ) { return formatTimeObj ( getTimeObj ( dateTime , timeZone ) , format ) ; } internal export function diff ( dateTime1 , timeZone1 , dateTime2 , timeZone2 , unit ) { return diffTimeObjs ( getTimeObj ( dateTime1 , timeZone1 ) , getTimeObj ( dateTime2 , timeZone2 ) , unit ) ; }