date icon indicating copy to clipboard operation
date copied to clipboard

ADD recognize weeks

Open allanlaal opened this issue 2 years ago • 3 comments

examples:

week nr 23
wk 23
week â„–23
week # 23
W23
2022#23
first day 9 AM of 2022#23
week number 23
first day 9 AM of 2022 week number 23
2022 week 23 first day 9 AM
2022 week nr 23
2022W23 // ISO format

allanlaal avatar May 26 '22 16:05 allanlaal

For the record, ISO format is already supported by PHP DateTime so both Carbon and JenssegersDate inherit it:

new \DateTime('2022W23')
new \Carbon\Carbon('2022W23')
new \Jenssegers\Date\Date('2022W23')

Maybe some other syntax are also natively supported this way.

kylekatarnls avatar May 26 '22 16:05 kylekatarnls

upstream: https://github.com/briannesbitt/Carbon/issues/2617

but detecting "week" and its formats is a heavily localized thing

allanlaal avatar May 26 '22 17:05 allanlaal

upstream said no, so this has to be completed here

allanlaal avatar Jun 12 '22 16:06 allanlaal