Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Module Ot_time_picker

module Ot_time_picker : sig..end

This module implements a clock-style time picker.


val make : 
  ?action:(int * int -> unit Lwt.t) Eliom_client_value.t ->
  ?init:int * int ->
  ?update:(int * int) React.E.t Eliom_client_value.t ->
  ?round_5:bool ->
  ?h24:bool ->
  unit ->
  [> `Div ] Eliom_content.Html.elt *
  (int * int) Eliom_shared.React.S.t *
  (unit -> unit) Eliom_client_value.t

make ?action ?round_5 ?h24 () produces a clock-style time picker for hours and minutes. The user is first asked to pick hours, then minutes with a separate clock.

If action is provided, it is called when a new time is available.

init (if provided) is the default displayed time.

update is a React event that can be used to trigger updates from outside.

If round_5 is true (default: false), the output for the minutes is rounded to multiples of 5.

If h24 is true (default: true), a 24-hour hour picker is used.

The first part of the output is the clock. The second part of the output is a reactive signal (h, m) where h are the hours and m the minutes that the user picked. The third part of the output is a function that can be called to go back to hours selection.

val make_hours_minutes_seq : 
  ?action:(int * int -> unit Lwt.t) Eliom_client_value.t ->
  ?init:int * int ->
  ?update:(int * int) React.E.t Eliom_client_value.t ->
  ?round_5:bool ->
  ?h24:bool ->
  unit ->
  [> `Div ] Eliom_content.Html.elt *
  (int * int) Eliom_shared.React.S.t *
  (unit -> unit) Eliom_client_value.t

Alias of make. Deprecated.