ionic-frameworkdatejs

Using DateJS in Ionic


In my web app i use datejs now i am building a mobile app with ionic and i wanted to use the same datejs but i realised that the total size of my app more than doubled when i included datejs.

So i looked into the datejs folder and i realised that even for the build there are a whole lot of files apart from the date.min.js, now i assume it is these files that are making my app bulky (from 2.6MB to 6.3MB), i would like to take them out by i do not know if the main date.min.js file is dependent on them.

Here is a screenshot of the datejs folder structure:

enter image description here

Inside the build folder:

enter image description here

And inside the production folder:

enter image description here

As you can see for a build there appear to be so many files, my main reason for using datejs and not the date filter in angularjs was because i tried performing an operation that kept on given me the date as "undefined" when i used the angularjs date filter no matter what i did, however when i switched to using datejs that issue was resolved.


Solution

  • The date.min.js is not dependent on the country specific files. You only require date.min.js.

    Hope this helps.