Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jquery/jquery-ui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7643a7d
Choose a base ref
...
head repository: jquery/jquery-ui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 64aae38
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 14, 2021

  1. DatePicker: Get selectedDay by data instead DOM html

    `selectDay()` use jQuery `html()` method on `td` cell to get the day value from DOM, but when user use translator or other extension, it return NaN value because the cell can contains non excepted content. We must use data- attribute to ensure that value cannot be altered.
    
    - https://jqueryui.com/resources/demos/datepicker/localization.html
    - https://translate.google.com/translate?hl=en&sl=fr&tl=pl&u=https%3A%2F%2Fjqueryui.com%2Fresources%2Fdemos%2Fdatepicker%2Flocalization.html
    
    We got
    ```html
    <td class=" " data-handler="selectDay" data-event="click" data-month="0" data-year="2021">
        <a class="ui-state-default" href="#">
            <font style="vertical-align: inherit;"><font style="vertical-align: inherit;">22</font></font>
        </a>
    </td>
    ```
    
    instead of
    ```
    <td class=" " data-handler="selectDay" data-event="click" data-month="0" data-year="2021">
       <a class="ui-state-default" href="#">22</a>
    </td>
    ```
    
    so this cannot work correctly
    ```
     inst.selectedDay = inst.currentDay = $( "a", td ).html();
    ```
    
    I think it's not a good practice to get value from html DOM element
    c-lambert committed Apr 14, 2021
    Configuration menu
    Copy the full SHA
    64aae38 View commit details
    Browse the repository at this point in the history
Loading