export interface DateRangeKey { from : number | string ; to : number | string ; } export function convertDateRangeToString ( { from , to } , format ) { if ( ! from ) { return 'Before ' + format ( to ) ; } else if ( ! to ) { return 'After ' + format ( from ) ; } else { return format ( from ) + ' to ' + format ( to ) ; } }