datetimepicker: can't find DateFormatter in 2.4.6

not ok 1 PhantomJS 2.1 - Global error: ReferenceError: Can't find variable: DateFormatter

worked in 2.4.5

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 4
  • Comments: 43 (4 by maintainers)

Commits related to this issue

Most upvoted comments

The .min.js file has code from another jquery plugin pasted into the top. Here is the JS file for the other plugin https://github.com/kartik-v/php-date-formatter/blob/master/js/php-date-formatter.js

+9999999999

I just fought with with today and came up with this solution if anyone still needs it package,json

"browser": {
    "jquery": "./node_modules/jquery/dist/jquery.js",
    "foundation": "./node_modules/zurb-foundation-5/js/foundation/foundation.js",
    "php-date-formatter": "./node_modules/php-date-formatter/js/php-date-formatter.js",
    "jquery-datetimepicker": "./node_modules/jquery-datetimepicker/jquery.datetimepicker.js"
  },
  "browserify-shim": {
    "jquery": "$",
    "foundation": { "exports": "foundation", "depends": ["jquery:$"]},
    "php-date-formatter": "DateFormatter",
    "jquery-datetimepicker": { "depends": ["php-date-formatter:DateFormatter"]}
  }

Then import and use:

require('jquery-mousewheel')($)
require('jquery-datetimepicker')($)

$('#myEl').datetimepicker()

sample is from a vue-cli generated project using browserify and imported in a .vue file

If the workable scripts can be accessed in build/, why not just remove the jquery.datetimepicker.min.js?

If you’re installing via npm, require('jquery-datetimepicker/build/jquery.datetimepicker.full') worked for me —instead of require('jquery-datetimepicker'). See PR #399

Is there some progress around this bug? It still appears in latest version.