dayjs
                                
                                 dayjs copied to clipboard
                                
                                    dayjs copied to clipboard
                            
                            
                            
                        fix: missing handling of week on manipulating duration
close #2582
Does this pr address #2479 , #2464?
Looks like the bug was introduced here: #2337
It has worked for my use case with patching based on this pr edit
does this pr address #2479 , #2464?
I hope so? I’d love to be able to update.
Thanks, can you please fix the failed unit test before this PR gets merged?
@iamkun, could you please clarify what is the logic behind as and get methods in the duration plugin?
Is my understanding correct that as converts the whole duration to the specified unit, ie how many weeks does this instance represent? And get retrieves only a part of the duration relevant to the instance unit, i.e I've provided "2 weeks" as part of the initial duration string => the method returns 2?
I'm not quite sure that I understand get method for weeks fully, because currently there seems to be a specific case for the weeks that basically makes this method act as as converting the whole duration in terms of weeks.
There is also a difference in parsing between milliseconds input not using weeks and other types of inputs accepting weeks.
Overall, It seems that there should be weeks stored in any parsing so that there is no extra logic for them except formatting, but I may be mistaken.
update:
opened a new pr #2648 implementing this logic.