Ticket #11251 (closed Feature Request: fixed)

Opened 3 years ago

Last modified 18 months ago

Archetypes calendar widget should manage minute steps

Reported by: gbastien Owned by:
Priority: minor Milestone: 4.x
Component: Archetypes Version: 4.0
Keywords: patch Cc:

Description

By default, while using the hours in the widget, the step is "5 minutes by 5 minutes". We should be able to define a different step like "1 minute by 1 minute", or "15 minutes by 15 minutes", ... I attached here above a patch for adapting this. A new attribute called minute_step appears in CalendarWidget... I attach above 2 files for patching Products.Archetypes and Products.CMFPlone. Almost nothing is changed and obviously the current way to do still works...

Attachments

patches.tgz Download (694 bytes) - added by gbastien 3 years ago.
Patches for Products.Archetypes and Products.CMFPlone

Change History

Changed 3 years ago by gbastien

Patches for Products.Archetypes and Products.CMFPlone

comment:1 Changed 22 months ago by kleist

  • Keywords patch added
  • Status changed from new to confirmed
  • Version set to 4.0

comment:2 Changed 22 months ago by kleist

The proposed pathes inline, if anybody's tempted to triage this proposal:

--- skins/archetypes/widgets/calendar.pt
+++ skins/archetypes/widgets/calendar.pt
@@ -39,6 +39,7 @@
                               starting_year widget/starting_year|nothing;
                               ending_year widget/ending_year|nothing;
                               future_years widget/future_years|nothing;
+                              minute_step widget/minute_step|nothing;
                               inputname fieldName;
                               formname string:edit_form;
                               inputvalue python:test(value!='None', value, '');">
--- Widget.py
+++ Widget.py
@@ -408,6 +408,7 @@
         'starting_year' : None,
         'ending_year' : None,
         'future_years' : None,
+        'minute_step' : 5,
         'helper_js': ('jscalendar/calendar_stripped.js',
                       'jscalendar/calendar-en.js'),
         'helper_css': ('jscalendar/calendar-system.css',),
--- skins/plone_templates/calendar_macros.pt
+++ skins/plone_templates/calendar_macros.pt
@@ -18,10 +18,11 @@
          ending_year ending_year | nothing;
          future_years future_years | nothing;
          show_single_year show_single_year | python: 1;
+         minute_step minute_step | python: 5;
          show_jscal show_jscal | python: 1;
          input_id string:${formname}_${inputname}_${inputIndex};
          date_components_support_view context/@@date_components_support;
-         values python:date_components_support_view.result(inputvalue, 0, starting_year, ending_year, future_years);
+         values python:date_components_support_view.result(inputvalue, 0, starting_year, ending_year, future_years, minute_step);
          years values/years;
          months values/months;
          days values/days;

comment:3 Changed 18 months ago by garbas

  • Status changed from confirmed to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.