add date time filter. move some functions to directive