From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>,
pve-devel@lists.proxmox.com, pmg-devel@lists.proxmox.com
Subject: [pmg-devel] applied: [PATCH widget-toolkit] datetimefield: fix changing date to end of month from short months
Date: Tue, 27 Feb 2024 14:34:29 +0100 [thread overview]
Message-ID: <8eacdc0c-c43e-4c17-8906-175cab765beb@proxmox.com> (raw)
In-Reply-To: <20240227132324.948467-1-d.csapak@proxmox.com>
Am 27/02/2024 um 14:23 schrieb Dominik Csapak:
> When selecting a new date, we get a date object from the currently
> selected date before the change. If that month has less days than what
> was selected for the new month, `setDate` will wrap that to the
> following month since the old month is still selected there.
>
> For example:
>
> select any date in april (has 30 days)
> then select the 31th of january
>
> this will actually select the 1st of january since we first get
>
> setDate: 20xx-04-XX -> 20xx-04-31 (wrap) -> 20xx-05-01
> setMonth: 20xx-05-01 -> 20xx-01-01
>
> To fix this, use the additional parameters of setFullYear[0] to set
> all of them simultaneously
>
> 0: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> src/form/DateTimeField.js | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
>
applied, thanks!
prev parent reply other threads:[~2024-02-27 13:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 13:23 [pmg-devel] " Dominik Csapak
2024-02-27 13:34 ` Thomas Lamprecht [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8eacdc0c-c43e-4c17-8906-175cab765beb@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox