Opened 6 years ago

Last modified 3 years ago

#28354 assigned New feature

Add a "humanized" widget for DurationField

Reported by: Nikita Levonovich Owned by: Artem
Component: Forms Version: dev
Severity: Normal Keywords: Duration field. Forms.
Cc: Adam Johnson Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes


Make a widget witch represents duration field as four NumberFields.

Change History (9)

comment:1 Changed 6 years ago by Nikita Levonovich

Owner: changed from nobody to Nikita Levonovich
Status: newassigned

comment:2 Changed 6 years ago by Nikita Levonovich

Owner: Nikita Levonovich deleted
Status: assignednew

comment:3 Changed 6 years ago by Tim Graham

Summary: Human readable duration field.Add a "humanized" widget for DurationField
Triage Stage: UnreviewedSomeday/Maybe

I'm uncertain if this is something that must be shipped with Django. Perhaps seeing a proposal will help evaluate the idea.

comment:4 Changed 5 years ago by Jens Timmerman

This should probably be 5 number fields, since the supported format is [DD] [HH:[MM:]]ss[.uuuuuu]?

comment:5 Changed 5 years ago by Nikita Levonovich

Jens Timmerman, Yea, you are right. I made some wrong counting.

comment:6 Changed 3 years ago by Artem

Owner: set to Artem
Status: newassigned
Version: 1.11master

comment:7 Changed 3 years ago by Artem

Will this widget be helpful ? I was using this in my few Django projects.

comment:8 Changed 3 years ago by Rupert Baker

Hi Artem,

I'm currently working on a project which needed a Duration Field widget, so we built something similar subclassing the MultiFieldWidget with 4x NumberInputs. Ours was slightly different as we didn't have an input for days but did for milliseconds (converted into microseconds). See dropbox screenshot.

I'm not a django expert but I'd be interested to discuss your approach with you as I think its a valid features.


comment:9 Changed 3 years ago by Adam Johnson

Cc: Adam Johnson added
Note: See TracTickets for help on using tickets.
Back to Top