Time class added and function in js