-
-
Notifications
You must be signed in to change notification settings - Fork 159
fix(date): persist all attributes passed by options #735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Do you need this only for |
I think it is mainly date-only.
Initially I thought, why not make everything consistently changable, because this method If you still insist to treat some fields differently than others, I can try to minimize the changes, but then we should at least document, which fields can be adjusted by this method and which not, and, most importantly, why they are not adjustable. Could you provide me some field-specific why-arguments, then I would include this into the documentation. |
Lua unfortunately does not allow (easily) to have private methods and fields. I need to revisit annotations to set what should be considered private and what is public.
I'd like to leave the things that are expected to be changeable, like what we currently have (day, month, year, hour, min, sec), and we can allow changing I agree that it needs to be documented. I would do that with a proper annotation on the |
Store all attributes passed as option via Date:set, especially date_only.
Minimize adjustable attributes to the smallest possible subset, that is actually needed.
I minimized the set of changeable fields to the minimum necessary for my PR. |
* fix(date): persist all attributes passed by options Store all attributes passed as option via Date:set, especially date_only. * chore: minimize adjustable attributes Minimize adjustable attributes to the smallest possible subset, that is actually needed. --------- Co-authored-by: Sebastian Flügge <[email protected]>
Store all attributes passed as option via Date:set, especially date_only.
I am raising this as a separate PR and precondition to PR #650. If we don't treat every field in the given date consequently, we get suprising behavior if some of the fields are present within the given "time" parameter. The idea of the function is, to allow adjusting an existing date instance by a subset of it's fields given as a table and returns the adjusted date as new value from the method.
This fix ensures, that every field can actually be adjusted within this function. I observed bugs while working on my time picker, if I used this function to get a Date object with adjusted time values (hours, minutes).