Skip to content

Feature add mask for work hours field in reports form#345

Merged
dybi merged 3 commits intomasterfrom
feature-improve-entering-hours
Jun 28, 2019
Merged

Feature add mask for work hours field in reports form#345
dybi merged 3 commits intomasterfrom
feature-improve-entering-hours

Conversation

@dybi
Copy link
Contributor

@dybi dybi commented Jun 26, 2019

resolves: #315

@dybi dybi added this to the next_release milestone Jun 26, 2019
@dybi dybi self-assigned this Jun 26, 2019
@dybi dybi changed the title Add data-mask for DurationFieldForm and unit test for it Feature add mask for work hours field in reports form Jun 26, 2019
Copy link
Contributor

@kbeker kbeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All OK, just please answer for question


class DurationFieldForm(forms.DurationField):
widget = DurationInput
widget = DurationInput(attrs={"data-mask": "99:99", "placeholder": "H:MM"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean that this field has 99:99 mask?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://dobsondev.com/2017/04/14/using-jquery-mask-to-mask-form-input/

  • ‘0’: {pattern: /\d/}
  • ‘9’: {pattern: /\d/, optional: true}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So shouldn't it be 90:00? Which means that you should have at least one digit before : and two after. This way you can type in values like 12:00, 8:00 and 0:30. Or maybe I have misunderstood this completely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quite frankly, it must be 09:99 (checked empirically;)).

Copy link
Contributor

@rwrzesien rwrzesien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I am a little bit curious about having two version of jquery and jquery-ui. Maybe removing older one can avoid unexpected issues.

@dybi dybi changed the title Feature add mask for work hours field in reports form [WIP] Feature add mask for work hours field in reports form Jun 27, 2019
@dybi dybi force-pushed the feature-improve-entering-hours branch from c594034 to faf4795 Compare June 28, 2019 10:28
@dybi dybi changed the title [WIP] Feature add mask for work hours field in reports form Feature add mask for work hours field in reports form Jun 28, 2019
@dybi dybi force-pushed the feature-improve-entering-hours branch from 2204cd3 to 4911733 Compare June 28, 2019 13:11
@dybi dybi merged commit 59b10a5 into master Jun 28, 2019
@dybi dybi deleted the feature-improve-entering-hours branch June 28, 2019 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the way of entering work hours when creating/editing report

3 participants