Opened 7 years ago

Last modified 5 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

Description

Make a widget witch represents duration field as four NumberFields.

Change History (9)

comment:1 by Nikita Levonovich, 7 years ago

Owner: changed from nobody to Nikita Levonovich
Status: newassigned

comment:2 by Nikita Levonovich, 7 years ago

Owner: Nikita Levonovich removed
Status: assignednew

comment:3 by Tim Graham, 7 years ago

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 by Jens Timmerman, 6 years ago

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

comment:5 by Nikita Levonovich, 6 years ago

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

comment:6 by Artem, 5 years ago

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

comment:7 by Artem, 5 years ago

Will this widget be helpful ? I was using this in my few Django projects.
https://user-images.githubusercontent.com/3278913/74968911-a9681700-5441-11ea-9a66-db804c22b52f.png

comment:8 by Rupert Baker, 5 years ago

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.

Rupert

https://www.dropbox.com/s/v7ttnzs8k1zi51n/Screenshot%202020-03-06%20at%2016.31.30.png

comment:9 by Adam Johnson, 5 years ago

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