
Security News
Python Adopts Standard Lock File Format for Reproducible Installs
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
@area17/parse-numeric-date
Advanced tools
Parse numeric based date inputs.
Date entry is hard for users. Date pickers, including the native one, aren't always the best for accessibility.
In his article "Maybe You Don't Need a Date Picker", Adrian Roselli proposes using a text field which users enter a date into, some client side does some parsing and then some feedback is presented to the user.
It is fairly straight forward to parse a known date format and convert to ISO format. But, what if users don't enter the date in your known format?
Well, that is what parse-numeric-date
attempts to solve.
https://area17.github.io/parse-numeric-date/
Firstly, install via npm:
$ npm install @area17/parse-numeric-date
Import into your JavaScript by:
import parseNumericDate from '@area17/parse-numeric-date'
And then in your JavaScript:
let isoString = parseNumericDate('29/12/25'); // 2025-12-29
If you want to have manual control over the locale:
let isoString = parseNumericDate('29/12/25', {
locale: 'en-GB' // will favor d/m/y over m/d/y
}); // 2025-12-29
parse-numeric-date
can parseThis parse-numeric-date
works with a big assumption:
Dates closer to today are better than dates years into the future
Date pickers for hotels, restaurants or events tend to be for things happening this year or next year. Dates of birth tend to happen from now to 100 years in the past. Retirement ages, mortgage completions tend to happen from now to 100 years in the future.
If the year difference is larger than 100, its probably useless. eg: a 29 in the string appear as 2922 rather than 29th of a month, 2022
parse-numeric-date
can't take natural input such as "December 12, 2022" - it is purely for parsing numeric inputs. Another assumption here is that such date entry, although natural in speech, isn't so natural to write or type - especially if the keyboard has been switched to a numeric keyboard on the users device.
If you want such parsing, perhaps you need:
Both are excellent, but can't parse numeric dates quite as fully as parse-numeric-date
.
You can see a comparison between parse-numeric-date
and anyDateParser
and parse-dob
over on Codepen: Date parse testing
parse-dob
by @HenrikJoreteg was a great inspiration, we think that forking parse-dob
and removing the previous date restriction would be very interesting.
AREA 17 is dedicated to building a welcoming, diverse, safe community. We expect everyone participating in the AREA 17 community to abide by our Code of Conduct. Please read it. Please follow it.
0.0.2
Make options, optional 🤦🏻♂️
FAQs
Parse numeric based date inputs
We found that @area17/parse-numeric-date demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
Security News
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.