uxsolutions / bootstrap-datepicker

A datepicker for twitter bootstrap (@twbs)
Apache License 2.0
12.67k stars 6.06k forks source link

Add AMD Support #1484

Open rposener opened 9 years ago

rposener commented 9 years ago

Include AMD support for the picker, and the locale files.

hebbet commented 9 years ago

AMD is already in upstream for 1.5.0

rposener commented 9 years ago

How about the locales?

Sent from my Windows Phone


From: hebbetmailto:notifications@github.com Sent: ‎7/‎13/‎2015 1:22 PM To: eternicode/bootstrap-datepickermailto:bootstrap-datepicker@noreply.github.com Cc: Ryan Posenermailto:ryanposener@msn.com Subject: Re: [bootstrap-datepicker] Add AMD Support (#1484)

AMD is already in upstream for 1.5.0


Reply to this email directly or view it on GitHub: https://github.com/eternicode/bootstrap-datepicker/issues/1484#issuecomment-121029110

HNygard commented 9 years ago

+1

domino14 commented 8 years ago

+1 does anyone know how to shim the locales? I can't get them to work at all.

domino14 commented 8 years ago

if anyone is wondering, I just wrapped an existing locale file with:

define([
  'datepicker'
], function() {

// the locale file code is here

});

And datepicker is just the path to the bootstrap-datepicker module.

rommsen commented 7 years ago

Is there any chance to get the locales working natively with amd?

ghybs commented 6 years ago

Hi,

While PR https://github.com/uxsolutions/bootstrap-datepicker/pull/1196 made the main script compatible with AMD and CommonJS using a UMD wrapper, locale files are still assuming jQuery is available globally.

See for example the French locale file: https://github.com/uxsolutions/bootstrap-datepicker/blob/d03ecd62619a871597abffc0cc6fd88f73b79020/js/locales/bootstrap-datepicker.fr.js#L5 https://github.com/uxsolutions/bootstrap-datepicker/blob/d03ecd62619a871597abffc0cc6fd88f73b79020/js/locales/bootstrap-datepicker.fr.js#L18

The fix would be to refactor all locale file to use the same UMD wrapper as the main file.