Updated to ensure it works in FFOS. Some issues with time inputs