JS time filter full functional