-1

I'm working with React and Rails and implementing material design in my app. I'm loading the modules using webpack. I have been able to get bootstrap-material-design and moment.js through npm but now, i want to integrate bootstrap material datepicker but i'm unable to use it as i cannot find a way to install it using npm. If a put a offline file in my client/app/javascripts folder and registers it in the webpack, i find the moment not defined error.

If a add a moment.js file in the folder as well, i get ./locale missing error. And when i put the locale folder provided by moment, i get the path error thati'm unable to reso;ve. I can across a similar issue but couldn't find a dsolution.

Thank you for any help. Please let me know if anymore information is required.

P.S.: I cannot include all of these in the assets of rails.

Aakanksha
  • 956
  • 1
  • 13
  • 26

1 Answers1

0

You should be able to install it with Bower according to it's docs.

bower install bootstrap-material-datetimepicker

If you don't have bower installed, you can install it with npm:

npm install -g bower

Magnum
  • 2,299
  • 4
  • 17
  • 23
  • Hey. I'm a stranger to `Bower`. Where do i install it? inside the root folder or the client or inside the node modules? Also, i did install the bootstrap material datepicker using the bower but i cant figure out how to load them or are they loaded automatically? I'm using Weback to load other modules. I'm still getting the `Uncaught TypeError: $(...).bootstrapMaterialDatePicker is not a function` – Aakanksha Oct 08 '16 at 05:24
  • You can install bower globally with npm with that command above. The - g tells npm to install it globally. After running the command, you shield be able to type 'bower' in your command line – Magnum Oct 09 '16 at 14:11
  • I'm able to install it and used it to install the `bootstrap-material-datetimepicker` as well. But do i have to load these files somewhere or they get loaded automatically. Because, I keep getting the `undefined (...).bootstrapMaterialDatePicker() is not a function`. – Aakanksha Oct 10 '16 at 04:02
  • Can you upload the file which is using bootstrap-material-datetimepicker? Maybe I need a little more context :) – Magnum Oct 10 '16 at 12:46
  • No Worries. I'll update the code. Actually i switched to jquery.timepicker. It had already consumed my lot of time and i'm on time limit here. – Aakanksha Oct 10 '16 at 13:52