Datamanager 2 JS date widget

This widget is built around the jQuery UI datepicker, it requires the date type or a subclass thereof.

Available configuration options:

  • boolean show_time: Boolean that controls, if the stored value is to be shown with or without the time-of-day. If omitted, 00:00:00 is assumed. Defaults to true.
  • int minyear: Minimum Year available for selection, default see below.
  • int maxyear: Maximum Year available for selection, default see below.

Default values for min/maxyear

If unspecified, it defaults to the 0-9999 range unless the base date type uses the UNIXDATE storage mode, in which case 1970-2030 will be used instead.

package midcom.helper.datamanager2

 Methods

_create_initscript ()

Generates the initscript for the current field.

Returns

stringThe init script.

_on_configuring ()

Adapts the min/maxyear defaults if the base date is set to UNIXDATE storage.

_on_initialize ()

Validates the base type.

add_elements_to_form ($attributes)

Adds a simple single-line text form element at this time.

Parameters

$attributes

add_head_elements ()

Adds the external HTML dependencies, both JS and CSS.
Static

A static flag prevents multiple insertions of these dependencies.

check_user_input (array $results)

Check against partially missing user input

Be liberal with input, strict with output

Parameters

$results

arrayUser input

Returns

stringFormatted date

freeze ()

Freeze the entire group, special handling applies, the formgroup is replaced by a single static element.

get_default ()

The default call produces a simple text representation of the current date.
todo do we really need to set this->format here?

render_content ()

Renders the date in the ISO format.

sync_type_with_widget ($results)

Tells the base date class instance to parse the value from the input field.

Parameters

$results

unfreeze ()

Unfreeze the entire group, special handling applies, the formgroup is replaced by a the full input widget set.

_create_elements (boolean $frozen)

Create the unfrozen element listing.

Parameters

$frozen

booleanShould the elements be frozen or not

_normalize_time_input ($string)

Parameters

$string

 Properties

 

String $format

Used date format
 

boolean $hide_seconds

Indicates whether the timestamp should include seconds or not.
 

int $maxyear

Maximum Year available for selection.
 

int $minyear

Minimum Year available for selection.
 

String $showOn

When should the calendar be shown (possible values: button, focus, both)
 

boolean $show_time

Indicates whether the timestamp should be shown or not.