https://github.com/holsee/string_date_parser
Kata for string date parsing
https://github.com/holsee/string_date_parser
Last synced: 2 months ago
JSON representation
Kata for string date parsing
- Host: GitHub
- URL: https://github.com/holsee/string_date_parser
- Owner: holsee
- Created: 2019-10-30T13:26:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-30T13:26:40.000Z (over 5 years ago)
- Last Synced: 2025-02-05T06:44:38.896Z (4 months ago)
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Date String Parser
Should take a string representing a period of time and return a number of milliseconds representing the amount of time.
The string should be of the form
`1y 2w 3d 4m`
Where `y` is year, `w` is week, `d` is day and `m` is minute (if that isn't obvious)
Should
- accept the arguments in any order i.e. `1d 3w` is valid
- accept decimal points i.e. `1.3w` weeksShould not
- accept more than one of each denomination i.e. '1y 1y' is invalid
- accept minus numbers i.e.## Bonus Points
A function which takes the output of the original function and returns a string of the format shown above.