owenmead / Pikaday

A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS
Other
153 stars 73 forks source link

Getting runtime Error: "Pikaday is not defined" after "jspm install" #48

Closed arjyamishra closed 7 years ago

arjyamishra commented 8 years ago

I have installed the library through jspm: [https://www.npmjs.com/package/pikaday-time]

jspm install npm:pikaday-time

and using in my code as:

import "pikaday-time";
....
picker = new Pikaday({
            field: ..... ,
            onSelect: () => {.... },
            onOpen: () => {.... },
            showTime: true
        });

....

Run time Error: "Pikaday is not defined" pikaday-time_error

Then I check the library dbushell/Pikaday and found that below 2 lines are present in file: pikaday@1.4.0/pikaday.js after installation

"format global"; "deps ./css/pikaday.css!";

So, after adding above 2 lines in installed file: pikaday-time@1.4.1/pikaday.js in place of

"format cjs";

everything seems to be working fine.

Kindly let me know if I am doing anything wrong or is there any problem with the installation or usage in the code.

Sayan751 commented 7 years ago

Facing the same issue with webapck. I am using var Pikaday = require("pikaday"); to load the Pikaday, which openup the control but missing the styles.

owenmead commented 7 years ago

import Pikaday from 'pikaday-time';