You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Jira)" <ji...@apache.org> on 2022/08/11 12:00:00 UTC

[jira] [Closed] (WW-2904) Problem with on the days following the last month of the year (or days before the first month)

     [ https://issues.apache.org/jira/browse/WW-2904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart closed WW-2904.
-----------------------------
    Resolution: Won't Fix

> Problem with <s:datetimepicker ../> on the days following the last month of the year (or days before the first month)
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-2904
>                 URL: https://issues.apache.org/jira/browse/WW-2904
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Dojo Tags
>    Affects Versions: 2.0.11.1, 2.0.11.2, 2.0.12, 2.0.13, 2.0.14
>            Reporter: Quinet Jérémie
>            Priority: Major
>             Fix For: 6.1.0
>
>
> When choosing a day that is after the 12/31 of the current year or before the 01/01 the month used by the datetimepicker taglib is not the correct one.
> I've seen the answer to the WW-2473 issue and understood it's fixed in the 2.1.x versions but i think i'm not the only one that is currently using only GA and would like to see this bug fixed for the 2.0.X branch.
> After checking the problem i've found it's in the DatePicker.js dojo file, the test to check if the day to display is before or after the current month is incorrect (line 243) :
> var curClass = (nextDate.getMonth()<this.curMonth.getMonth())?'previous':(nextDate.getMonth()==this.curMonth.getMonth())?'current':'next';
> it doesn't test if the day is on the next  (or previous) year.
> Checking on the last 0.4.X dojo version available (0.4.3) this problem is fixed (i don't know which dojo version struts 2.0.14 currently use), the line is replaced with :
> var curClass = (nextDate.getMonth() != this.curMonth.getMonth() && Number(nextDate) < Number(this.curMonth))?'previous':(nextDate.getMonth()==this.curMonth.getMonth())?'current':'next';
> Couldn't it be possible to use the 0.4.3 version of dojo for the next 2.0.X version of Struts ?
> Thanks.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)