question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Insert leading "0"s in hour/minute, days and months

See original GitHub issue

If the user types “0” to insert any value (day, hour, minute or month) the input ends up with “00” before the value.

Example: Let’s say the user wants to type the following date: “04-02-2019 09:05”. If the user types exactly these characters sequence below:

0 4 0 2 2 0 1 9 0 9 0 5

It will end up with this value in the screen: 004-002-20199, 005:mm

Kapture 2019-12-02 at 11 17 06

The desired result would be if the user could (our should/must) insert “04” or “4”. Maybe some prop configuration flag?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
wojtekmajcommented, Jul 9, 2020

This will be fixed, but it needs https://github.com/wojtekmaj/react-date-picker/pull/272 to be merged first. For now, we rely on number inputs (from today’s point of view I think that was a mistake), which don’t report leading zeros in values, so we’re technically unaware of them.

2reactions
wojtekmajcommented, Mar 24, 2021

Released react-date-picker v8.1.1 and react-time-picker v4.2.1, this should resolve the issue. Please mind that your lockfile may prevent secondary dependencies from being updated without your manual intervention.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to add leading zeros to the day and month in rails ...
I'm trying to add leading zeros to the days and months in a date_select, and for all I can see in the docs...
Read more >
Leading zeros in Excel: how to add, remove and hide - Ablebits
To add leading zeros, here's what you do: Select the target cells and run the Add/Remove Leading Zeros tool.
Read more >
Formatting date/time (w/o adding the "0") - Codecademy
Does anyone know how to get the date/time to format correctly when the month/day/hour/min is a SINGLE digit? BTW, I'm not talking about...
Read more >
MATLAB datevec - MathWorks
This MATLAB function converts the datetime or duration value t to a date vector—that is, a numeric vector whose six elements represent the...
Read more >
datetime — Basic date and time types — Python 3.11.1 ...
Attributes: year , month , day , hour , minute , second , microsecond , and tzinfo . ... class datetime.timedelta(days=0, seconds=0, microseconds=0, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found