ICEfaces
  1. ICEfaces
  2. ICE-10918

ace:dateTimeEntry "Now" button should honor timeZone attribute

    Details

    • Assignee Priority:
      P2
    • Support Case References:
      Support Case 13652:-https://icesoft.my.salesforce.com/5007000001XOeY6

      Description

      Currently when using the popup version of the ace:dateTimeEntry widget, the "Now" button does not honor the timeZone entry.
      change Showcase "popup" example of this component to:-
            <h:panelGrid style="margin-left: auto; margin-right: auto; text-align: center;" width="100">
                          <ace:dateTimeEntry id="cal"
                                                         value="#{datePopup.selectedDate}"
                                                         timeZone="#{datePopup.selectedTimeZone} "
                                                         pattern="MMM/dd/yyyy hh:mm z"
                                                         renderAsPopup="#{datePopup.popup}">
                           </ace:dateTimeEntry>
                          <h:commandButton id="submit" value="Submit Date"/>

      and allow the user to select a timeZone:-
                          <h:panelGroup>
                              <h:outputLabel for="tzinput" value="Select TimeZone:-"/>
                              <h:selectOneMenu id="tzinput" value="#{datePopup.selectedTimeZone}">
                                  <f:selectItems value="#{datePopup.timeZones}"/>
                              </h:selectOneMenu>
                          </h:panelGroup>

      ....
      with DatePopupBean:-

      (in constructor)...

              String[] ids = TimeZone.getAvailableIDs();
              for (String id : ids){
                  timeZones.add(new SelectItem(id, displayTimeOffset(id) ));
              }

         public String displayTimeOffset(String id){
              TimeZone zone = TimeZone.getTimeZone(id);
              long hours = TimeUnit.MILLISECONDS.toHours(zone.getRawOffset());
      long minutes = TimeUnit.MILLISECONDS.toMinutes(zone.getRawOffset())
                                        - TimeUnit.HOURS.toMinutes(hours);
      minutes = Math.abs(minutes);
      String result = "";
              String hrs = String.valueOf(hours) ;
           // System.out.println(" hours="+hours+" hrs="+hrs);
      if (hours > 0) {
      result = "(GMT+"+hrs+":"+hrs+") "+ String.valueOf(minutes);
      } else {
      result = "(GMT"+hrs+":"+hrs+")"+ String.valueOf(minutes);
      }

      return result;
          }
      ...
      when you use the "now" button on the popup of the widget, you can change the timeZone and then select a time, but the "Now" button will always reflect the "Now" for the browser locale.
      Should this not reflect the "Now" in the timeZone that is currently selected? OTherwise, do we improve it to have another attribute that forces this?
      1. datepopup.xhtml
        3 kB
        Carmen Cristurean
      2. DatePopupBean.java
        3 kB
        Carmen Cristurean
      1. 1.PNG
        266 kB
      2. 2.PNG
        169 kB

        Activity

        Judy Guglielmin created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Assignee Arturo Zambrano [ artzambrano ]
        Fix Version/s EE-4.1.0.GA [ 12171 ]
        Assignee Priority P2 [ 10011 ]
        Ken Fyten made changes -
        Fix Version/s EE-3.3.0.GA_P04 [ 12270 ]
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Carmen Cristurean made changes -
        Attachment DatePopupBean.java [ 22047 ]
        Attachment datepopup.xhtml [ 22048 ]
        Carmen Cristurean made changes -
        Attachment datepopup.xhtml [ 22048 ]
        Carmen Cristurean made changes -
        Attachment DatePopupBean.java [ 22047 ]
        Carmen Cristurean made changes -
        Attachment DatePopupBean.java [ 22049 ]
        Attachment datepopup.xhtml [ 22050 ]
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Carmen Cristurean made changes -
        Attachment datepopup.xhtml [ 22050 ]
        Carmen Cristurean made changes -
        Attachment DatePopupBean.java [ 22049 ]
        Carmen Cristurean made changes -
        Attachment datepopup.xhtml [ 22181 ]
        Attachment DatePopupBean.java [ 22182 ]
        Arturo Zambrano made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Carmen Cristurean made changes -
        Attachment 1.PNG [ 22183 ]
        Attachment 2.PNG [ 22184 ]
        Ken Fyten made changes -
        Fix Version/s EE-4.1.0.BETA [ 13072 ]
        Ken Fyten made changes -
        Fix Version/s 4.2.BETA [ 13091 ]
        Fix Version/s 4.2 [ 12870 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Judy Guglielmin
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: