parse-human-relative-time
parse-human-relative-time copied to clipboard
Unable to define weekStartsOn parameter
Some countries might start the week on another day, which can be configured in date-fns weekStartsOn parameter.
Unfortunately, this cannot be passed over here due to fixed lexing: https://github.com/derhuerst/parse-human-relative-time/blob/1fd21930e4568588233f33746984a152ba9bc6ab/date-fns.js#L18
Can we figure a way, a solution, how to support such a parameter?
Huh, this is a tricky problem.
Without trying it out, I think the best way is to
- add an optional
opt = {}tocreateParse const {weekStartsOn} = {weekStartsOn: 0, ...opt}- if
cmdis adate-fnscommand where theweekStartsOnoption is accepted, pass it into args viaargs = [...args, {weekStartsOn}].
PR welcome!