Closed shashankbhat10 closed 2 months ago
Thanks for this contribution and sorry for the log delay in reviewing this. I think we'll pass on this. It's not that it isn't correct; it's that it's easy enough to do in "userspace". We have tried (with mixed success) to avoid feature creep like this.
I have a couple of questions regarding this. @diesieben07
What should be the expected behaviour when weekday argument is incorrect(eg: weekday is a string or the weeday value is out of valid range). Should the method be throwing an InvalidArgumentException?
Currently, the method will return the DateTime with the next/previous weekday. So, if the current weekday is Monday(1) and the methods are called with argument as 1, the method does not return the current date but the previous or next Monday. Is this the correct behaviour?
resolves https://github.com/moment/luxon/issues/1517