This is a date object that allows you to enter a date. This class is based
on the Lspinner class. The spinner adds 1 day
or subtracts one day from the date. This includes an additional button that
opens the Lcalendar_window object
allowing you to interactively select a date and/or time. To change the
default format for all date objects you can redefine the default_date_format method. To change the
default format for the time for all date objects you can redefine the default_time_format method.
Here are some interesting differences regarding events in the Ldatebox object:
- The :on_change event is raised only once
just before the :on_after_update event
when typing the date into the text box. It does not make since to raise an
:on_change after every key stroke
because the date may not be a valid date.
- The :on_change event is raised when any
of the buttons are used to set or selected a date.
Here is a list of additional attributes supported only by the Ldatebox class:
- :otype=>:include_time - by default, Ldatebox
does not show the time. Set this to true to also include the time. The
default :date_format is ’%m/%d/%Y
%I:%M %p’.
- :date_format=>’%m/%d/%Y’
- a string defining the format of the date you desire. These are defined by
Time.strftime. The default is
’%m/%d/%Y’.
- :time_format=>’ %I:%M
%p’ - a string defining the format of the time you desire. The
leading space is import unless you don’t want a separator between the
date and time. These are defined by Time.strftime.
The default is ’%I:%M %p’. This is Ignored unless :otype =
:include_time.
- :value - this can a string containing a valid date or a Time object.
Operation:
- Shift PageUp/PageDown opens the interactive calendar window (Lcalendar_window object)
- ’-’ - subtracts one day
- ’+’ - adds one day
- Up arrow - adds one day
- Down arrow - subtracts one day
- Page Up key - adds one month
- Page Down key - subtracts one month
- Shift Up arrow - adds one hour
- Shift Down arrow - subtracts one hour
- Ctrl Up arrow - adds one minute
- Ctrl Down arrow - subtracts one minute
- Alt Up arrow - opens the interactive calendar window (Lcalendar_window object)
- Alt Down arrow - opens the interactive calendar window (Lcalendar_window object)
add_seconds,
clientW,
close,
date_format,
date_format=,
default_date_format,
default_time_format,
get_date,
include_objects,
include_time?,
move,
on_decrement,
on_down_key,
on_increment,
on_key_press,
on_pagedown_key,
on_pageup_key,
on_up_key,
open,
open_calendar,
pixel_width,
prepare,
state=,
time_format,
time_format=,
valid_attribute?,
value,
value=,
Returns the default date format used by the Ldatebox object. The default is
’%m/%d/%Y’. To change the default for all dates, you can
redefine this method to return the date format of your choice. You can also
include the following in a theme to have a per-theme default:
:default => {
:datebox => {:date_format=>'%m/%d/%Y', :time_format=>' %I:%M %p'}
},
These values can be supplied directly to the object so you can have a
different format for each Ldatebox object.
This method returns the default time format used by the Ldatebox object. See default_date_format() above for more
details. Ignored unless :otype = :include_time. The default is ’
%I:%M %p’.
Close this object, we need to make sure we close the listbox and button.
Make sure the button is positioned and sized correctly. The height of the
buttons matches the height of the spinner.
Repositions the button based on the new size of the datebox.
Sets the date format for this object. Please note, this should not include
the time format.
- new_value - a string used to format the date in the datebox. For example:
’%m/%d/%Y’.
Sets the time format for this object. Please note, this should not include
the date format.
- new_value - a string used to format the time in the datebox. For example:
’ %I:%M %p’ the space is important if you want a separator
between the date and time
The pixel width of the textbox + the width of the buttons.
The pixel width of the spinner less the pixel width of the button.
Returns true when this datebox includes the time.
Forward this to the button.
Returns the value in the textbox as a date (Time
object). Raises InvalidDateError if the
date in the datebox is invalid. Alias for value.
Returns the content of the datebox as a Time
object. Alias for get_date.
Sets the date in the datebox. new_value - a Time
object.
Adds one day to the date.
Subtracts one day from the date.
Add seconds to the date in the datebox.
Opens the Lcalendar_window, allows the
user to interactively select a date, places the selected date in the
textbox, and triggers the :on_change
event after a date has been selected.
Holding shift, ctrl, or alt opens the calendar window, otherwise adds 1
month to the date.
Holding shift, ctrl, or alt opens the calendar window, otherwise subtracts
1 month from the date.
- Up arrow - adds one day
- Shift Up arrow - adds one hour
- Ctrl Up arrow - adds one minute
- Alt Up arrow - opens the interactive calendar window (Lcalendar_window object)
- Down arrow - subtracts one day
- Shift Down arrow - subtracts one hour
- Ctrl Down arrow - subtracts one minute
- Alt Down arrow - opens the interactive calendar window (Lcalendar_window object)
’+’ key adds 1 day, ’-’ key subtracts 1 day.
Thank you for taking the time to visit this web page. I trust you found the information contained in this page useful.
Please email any questions, concerns, or issues with this web site to webmaster@sevasoftware.com.
Please remember Seva Software when your company would benefit from an experienced database architect and software engineer.