Expose an ES6 module shim for the global Sugar
instance’s Date
and all defined locales.
$ ember install ember-sugar-date-shim
sugar-date
NPM package.Import the Sugar global instance in your controller, route, or component js-file:
import Sugar from 'ember-sugar-date';
Then somewhere in your js-code, you can use the Sugar.Date
object as you normally would. For example:
return Sugar.Date.full(new Date());
This README outlines the details of collaborating on this Ember add-on.
git clone git@github.com:cybertoothca/ember-sugar-date-shim.git
cd ember-sugar-date-shim
npm install
yarn
ember serve
npm test
(Runs ember try:each
to test your add-on against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit https://ember-cli.com.
npm link
command to link this add-on within your local
node repository.npm link ember-sugar-date-shim
.package.json
and add the ember add-on with the version *. It will
look something like this: "ember-sugar-date-shim": "*"
. Now
when/if you execute npm install
on this other project it
will know to look for the linked add-on rather than fetch it from
the central repository.npm uninstall -g ember-sugar-date-shim
ember-sugar-date-shim
in your other project’s package.json
.npm prune
from the root of your other project’s command line.