Time interval filter in js