RobinHerbots / RobinHerbots/Inputmask

Treat 24:00 as an equivalent of 00:00

Open
#1,237 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dates Enhancement / Feature Mask Extension
Dominant language
JavaScript
Stars
6.5k
Forks
2.1k
Avg merge
4d 16h
Merged PRs (30d)
1

Description

We have users entering punch in / punch out times into a timesheet and we use this great inputmask library with a basic 'h:s' mask.

Users can enter in/out times like '08:30' - '17:00', which works great.

When the user works a night shift and started working before midnight and finishes after midnight he enters time like so '23:00' - '06:00' (for example Monday night 23:00 until Tuesday morning 06:00)

In cases where we don't allow time entry that passes into the next day we currently set the 'punch out' time to '00:00', signifying the user can only enter time until midnight. So '23:00' - '06:00' gets truncated to '23:00' - '00:00'. (Some customers' back-end systems don't allow timespans across multiple days)

We would like to truncate to '24:00' so it becomes clear to the user they entered a valid punch out time but the system doesn't allow more than 24:00 hours.

If i simply set the input field value like this j$(element).val('24:00') the input field value becomes '20:0_' instead of '24:00'.

I understand 24:00 is not exactly a valid moment in time but for a nicer user experience it would be great to allow this input and treat it as '00:00'

Thanks for reading this far, can't wait to get some thoughts on this.

Regards,

Leon

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the basic h:s time mask and reproduce setting the field to 24:00, which currently becomes 20:0_. The work is done when 24:00 is accepted and treated as equivalent to 00:00 while preserving the requested user-facing value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.