Ticket #6246 (closed enhancement: fixed)

Opened 4 months ago

Last modified 4 months ago

[PATCH] Generalized date fields for use elsewhere

Reported by: terje Assigned to: doki_pen
Priority: normal Component: DateFieldPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

  • Configurable request match (for using datepicker elsewhere)
  • Instead of attaching a separate datepicker to explicit fields, attach to class=datepicker + use a stream filter to set the class attribute of input elements
  • (Limited) support for using datepicker for milestone due/completed (default=off)

Not really tested, Works For Me..

Attachments

generalized.diff (3.9 kB) - added by terje on 11/23/09 19:12:21.
Generalized a litte, plus new features
generalized2.diff (4.1 kB) - added by terje on 11/24/09 13:06:14.
Fixed request match to handle webadmin, and dont assign anything to data.ids

Change History

11/23/09 19:12:21 changed by terje

  • attachment generalized.diff added.

Generalized a litte, plus new features

11/24/09 13:06:14 changed by terje

  • attachment generalized2.diff added.

Fixed request match to handle webadmin, and dont assign anything to data.ids

11/25/09 05:15:39 changed by doki_pen

  • status changed from new to assigned.

(follow-up: ↓ 4 ) 11/26/09 02:19:03 changed by anonymous

Will

 attr('class', 'datepick') 

cause problems if the sites template uses a class already? Is there a way we can append the class?

11/26/09 06:36:23 changed by doki_pen

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [7192]) generalize datepicker

Now kinda works with milestones. Uses a class name instead for future enhancements. fixes #6246. thanks terje!

(in reply to: ↑ 2 ) 11/26/09 09:26:51 changed by terje

Replying to anonymous:

Will {{{ #!python attr('class', 'datepick') }}} cause problems if the sites template uses a class already? Is there a way we can append the class?

Yes I think it will cause trouble. Not sure what is the best solution. Maybe leave the class alone if it is set already by default? (override option)

Ultimately I think we can solve it by attaching to IDs _and_ classes (so we'd be able to have H:M:S for milestone fields etc), akin to:

[datefield]
class=ticket_due,milestone_due,milestone_comp
id=special_field1,special2
ticket_due.format = ymd
milestone_comp.format = ymdhis

And use this config to create a list of .classes and #fields to attach datepicker to. This is actually what I do in production, but it's very messy.

On a sidenote, I notice this doc= change in [7192] "(..) you must use MM/DD/YYYY for the date format. Set format to mdy and separator to / (..)".

This depends on locale - I use DD-MM-YYYY for milestones.


Add/Change #6246 ([PATCH] Generalized date fields for use elsewhere)




Change Properties
Action