<commit_before>
###
 jQuery UI Datepicker plugin wrapper
 
 @param [ui-date] {object} Options to pass to $.fn.datepicker() merged onto ui.config
###
angular.module('ui.directives').directive 'uiDate', ['ui.config', (uiConfig)->
  options = {};
  if uiConfig.date?
    angular.extend(options, uiConfig.date)

  require: '?ngModel',
  link: (scope, element, attrs, controller)->
    opts = angular.extend({}, options, scope.$eval(attrs.uiDate));

    ### If we have a controller (i.e. ngModelController) then wire it up ###
    if controller?
      updateModel = (value, picker)->
        scope.$apply ()->
          controller.$setViewValue(element.datepicker("getDate"))

      if opts.onSelect?
        ### Caller has specified onSelect to call this as well as updating the model ###
        usersOnSelectHandler = opts.onSelect
        opts.onSelect = (value, picker)->
          updateModel(value)
          usersOnSelectHandler(value, picker)
      else
        ### No onSelect already specified so just update the model ###
        opts.onSelect = updateModel

      ### Update the date picker when the model changes ###
      originalRender = controller.$render
      controller.$render = ()->
        originalRender()
        element.datepicker("setDate", controller.$viewValue)

    ### Create the datepicker widget ###
    element.datepicker(opts)

]<commit_msg>Removed unnecessary call to the original $render which is actually a no-op.<commit_after>
###
 jQuery UI Datepicker plugin wrapper
 
 @param [ui-date] {object} Options to pass to $.fn.datepicker() merged onto ui.config
###
angular.module('ui.directives').directive 'uiDate', ['ui.config', (uiConfig)->
  options = {};
  if uiConfig.date?
    angular.extend(options, uiConfig.date)

  require: '?ngModel',
  link: (scope, element, attrs, controller)->
    opts = angular.extend({}, options, scope.$eval(attrs.uiDate));

    ### If we have a controller (i.e. ngModelController) then wire it up ###
    if controller?
      updateModel = (value, picker)->
        scope.$apply ()->
          controller.$setViewValue(element.datepicker("getDate"))

      if opts.onSelect?
        ### Caller has specified onSelect to call this as well as updating the model ###
        usersOnSelectHandler = opts.onSelect
        opts.onSelect = (value, picker)->
          updateModel(value)
          usersOnSelectHandler(value, picker)
      else
        ### No onSelect already specified so just update the model ###
        opts.onSelect = updateModel

      ### Update the date picker when the model changes ###
      controller.$render = ()->
        element.datepicker("setDate", controller.$viewValue)

    ### Create the datepicker widget ###
    element.datepicker(opts)

]
{'fraction_non_alphanumeric': 0.1278772378516624, 'fraction_numerical': 0.0, 'mean_word_length': 3.0804769001490313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6331031', 'n_tokens_mistral': 746, 'n_tokens_neox': 735, 'n_words': 226}