Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DateChooser in 8.3 does not show the right month,year

    I am using smartclient DateChooser for calendar on my form items (not a smartclient form item). When user clicks on the calendar icon, I set the date using setData method to show the date as per the value of the form item (editable directly by user).

    dateChooser.setData(date);

    This pops up the right calendar for the month and selects the right date but does not show the right year/month in the calendar header. Always shows the current month, year. If you click on the next/previous month icons, then it shows the right month.

    This was working with 8.2v.

    Looks bug to me. Please let me know the workaround for this.

    #2
    I am sure this is a bug. I tried even on smartclient widget. Just edit the date in the form item manually and then click the icon to open the calendar. This shows everything as per the date in the form item except the Month and Year. It keeps showing the Month, Year as per user's last interaction with the calendar.

    Please provide some fix on this. I am using this on many fields in my portal and everywhere it's the same issue.

    I have SmartClient_v83p_2012-11-27
    Last edited by asingla; 12 Dec 2012, 10:34.

    Comment


      #3
      Please try putting together a minimal test case that you run outside of your app (so it is not affected by system-wide settings like date input format / display timezone). If that shows an issue, we can take a look.

      You should also test with the latest 8.3p build, just in case.

      Comment


        #4
        It's there on your feature explorer.

        Go here.
        http://www.smartclient.com/docs/8.3/...ateRangeFilter

        Open the date range filter dialog in Nationhood filter in MiniDateRangeItem filter and then type in 10/01/2012 and then click on the icon to open the calendar. Check out the header label. It will show Dec 2012 but in reality the month being shown is Oct. You can verify by clicking on next/prev month icon.


        Some how the same problem does not exist if the filter is normal date (not a date range).

        I have the same issue as I am using DateRangeFilters as well as my own custom date picker which I constructed to use with regular form fields.

        Please see the attached file.
        Attached Files

        Comment


          #5
          If you test with the 8.3 docviewer files you are not testing with the latest patch build.

          You have a bunch of usage issues in your code, including direct access to DOM elements managed by SmartClient, and what looks like bad date handling code - read the Date Format & Storage overview for details.

          If you can produce a test case without these issues that's actually been tested against the latest patch build, let us know.

          Comment


            #6
            I tested with latest nightly build (SmartClient_v83p_2012-12-12_Pro.zip) downloaded today and was able to reproduce this issue.

            I am not sure what issues you are referring with the code, but this same code was working with 8.2

            Ignore the last line in the code.
            this.datePicker.reflowNow();

            Comment


              #7
              Broken code that happens to work in 8.2 isn't guaranteed to work in 8.3, that's why we ask that you stick to documented APIs.

              Again, please look over our previous comments; if you provide a valid test case showing a bug, let us know.

              Comment


                #8
                So you are saying that it was a bug (as its reproducible on your feature explorer) and has been fixed in the latest nightly build.

                Comment


                  #9
                  Ok. As per the latest build, DateRangeDialog is working correctly but the issue is reproducible against SmartClient_v83p_2012-11-27 build. So there was an issue.

                  That said, code written by me is still not working.

                  Where I can find "Date Format & Storage overview" and I will appreciate if you can tell me the issues in the code.

                  Comment


                    #10
                    In general, use search to find any document we refer you to. Here's a link. Read about logical dates vs logical times vs datetime values and APIs to correctly obtain and convert between these (which is actually incredibly tricky).

                    Separately, your test case directly reaches into the generated DOM, which is considered internal, and is invalid to directly access.

                    Comment


                      #11
                      I read the link and I was aware of most of facts but I am still not sure what's wrong with my test case.

                      In our web application, we have pages based on smartclient as well as regular HTML pages. Now in one of the regular page we have to use Calendar. So to be consistent with other pages for date picker (calendar), I decided to choose DateChooser.

                      As per the docs, I believe DateChooser is an independent component and I have used this as per the docs (getData and setData). I will appreciate if you can tell me what's wrong in the code or any other way I can use this calendar widget in my regular html pages.

                      Comment


                        #12
                        It's fine to use SmartClient within a regular web page. It's not OK to use a SmartClient widget, such as a FormItem, and then reach in and access or modify the DOM generated by that SmartClient widget.

                        However, on a second look, you used the name "FormItem" but you were actually just working with a native <input> element that you directly created. This, in itself, is fine.

                        However your means of constructing and parsing dates is still wrong, and is the reason your test doesn't work - you need to look at the logicalDate, logicalTime vs datetime discussion in the Date Overview we referred you to, and use the documented helper methods for correct construction of dates and times.

                        Comment


                          #13
                          This issue exists for SmartGWT 3.1 + GWT 2.5

                          Please find attached test application using which the issue of showing incorrect month and year on header can be replicated.

                          Attached are four source files good enough for replicating this issue.

                          DateTextItem.java (6.0 KB)
                          SmartGwtTestbedEntryPoint.java (854 Bytes)
                          SmartGwtTestbed.gwt.xml (1.0 KB)
                          SmartGwtTestbedHtml.html (541 Bytes)

                          Please note that this would require gwtx-1.5.2.jar for SimpleDateFormat GWT implementation.

                          Thanks,
                          Jayesh
                          Attached Files

                          Comment


                            #14
                            This test case works as expected for us against latest 3.1 - that is, typing in a valid date and then clicking the Picker icon shows the popup DateChooser with appropriate Month and Year headings.

                            Please confirm if those are the actions you're taking that result in this issue you're seeing, and that you are using the latest build of 3.1 from smartclient.com/builds.

                            Comment


                              #15
                              SmartGWT 3.1 (LGPL), GWT 2.5, FireFox 24

                              Hi,

                              Please find attached screenshot which shows that the issue is being reproduced with the give test case.
                              Attached Files

                              Comment

                              Working...
                              X