continuouscalendar / jquery-continuous-calendar

Date picker and range selector with scrollable months instead of paged (the only right way to do it)
http://continuouscalendar.github.io/jquery-continuous-calendar/
85 stars 35 forks source link

Add optional AMD support #43

Closed tkareine closed 12 years ago

tkareine commented 12 years ago

Applied UMD pattern to Date* libraries and the plugin itself. Now, when loading the calendar plugin with an AMD loader, such as RequireJS, we avoid polluting the global window object. In addition, Date* libraries can be loaded individually:

define(['DateTime'], function(DateTime) {
  // use DateTime in user code
})

When not using an AMD loader, we inject Date* libraries into the global window object as before.

A benefit of applying the UMD pattern is that the dependencies of each module and changes to the global window object are explicit.