Package s3 :: Module s3widgets :: Class S3DateTimeWidget
[frames] | no frames]

Class S3DateTimeWidget

source code

??-297 --+
         |
        S3DateTimeWidget

Date and/or time picker widget based on jquery.ui.datepicker and jquery.ui.timepicker.addon.js.

Instance Methods
 
__init__(self, **opts)
Constructor
source code
 
__call__(self, field, value, **attributes)
Widget builder.
source code
 
inject_script(self, field, value, **attributes)
Helper function to inject the document-ready-JavaScript for this widget.
source code
Method Details

__init__(self, **opts)
(Constructor)

source code 

Constructor

Parameters:
  • opts - the widget options
  • date_format - the date format (falls back to deployment_settings.L10n.date_format)
  • time_format - the time format (falls back to deployment_settings.L10n.time_format)
  • separator - the date/time separator (falls back to deployment_settings.L10n.datetime_separator)
  • min - the earliest selectable datetime (datetime, overrides "past")
  • max - the latest selectable datetime (datetime, overrides "future")
  • past - the earliest selectable datetime relative to now (hours)
  • future - the latest selectable datetime relative to now (hours)
  • min_year - the earliest year in the drop-down (default: now-10 years)
  • max_year - the latest year in the drop-down (default: now+10 years)
  • hide_time - Hide the time selector (default: False)
  • minute_step - number of minutes per slider step (default: 5)
  • weeknumber - show week number in calendar widget (default: False)
  • month_selector - show drop-down selector for month (default: False)
  • year_selector - show drop-down selector for year (default: True)
  • buttons - show the button panel (default: True)
  • set_min - set a minimum for another datetime widget
  • set_max - set a maximum for another datetime widget

__call__(self, field, value, **attributes)
(Call operator)

source code 

Widget builder.

Parameters:
  • field - the Field
  • value - the current value
  • attributes - the HTML attributes for the widget

inject_script(self, field, value, **attributes)

source code 

Helper function to inject the document-ready-JavaScript for this widget.

Parameters:
  • field - the Field
  • value - the current value
  • attributes - the HTML attributes for the widget