https://github.com/cybertoothca/ember-sugar-date-shim
Expose an ES6 module shim for the global `Sugar` instance's `Date` and all defined locales.
https://github.com/cybertoothca/ember-sugar-date-shim
Last synced: 9 months ago
JSON representation
Expose an ES6 module shim for the global `Sugar` instance's `Date` and all defined locales.
- Host: GitHub
- URL: https://github.com/cybertoothca/ember-sugar-date-shim
- Owner: cybertoothca
- License: mit
- Created: 2018-01-08T01:51:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-08T03:12:50.000Z (over 8 years ago)
- Last Synced: 2025-03-16T02:27:59.602Z (about 1 year ago)
- Language: JavaScript
- Homepage: http://ember-sugar-date-shim.cybertooth.io
- Size: 79.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-sugar-date-shim
 [](http://badge.fury.io/js/ember-sugar-date-shim)  [](http://circleci.com/gh/cybertoothca/ember-sugar-date-shim) [](http://codeclimate.com/github/cybertoothca/ember-sugar-date-shim)  [](http://emberobserver.com/addons/ember-sugar-date-shim)  [](https://github.com/cybertoothca/ember-sugar-date-shim/blob/master/LICENSE.md)
## Purpose
Expose an ES6 module shim for the global `Sugar` instance's `Date` and all defined locales.
## Installation
```bash
$ ember install ember-sugar-date-shim
```
### Requirements
* Ember >= 1.13.0
### Dependencies
* The latest release version of the `sugar-date` NPM package.
### Tested Against
[](https://circleci.com/gh/cybertoothca/ember-sugar-date-shim)
[](https://circleci.com/gh/cybertoothca/ember-sugar-date-shim)
[](https://circleci.com/gh/cybertoothca/ember-sugar-date-shim)
[](https://circleci.com/gh/cybertoothca/ember-sugar-date-shim)
[](https://circleci.com/gh/cybertoothca/ember-sugar-date-shim)
[](https://circleci.com/gh/cybertoothca/ember-sugar-date-shim)
[](https://circleci.com/gh/cybertoothca/ember-sugar-date-shim)
## Usage
Import the Sugar global instance in your controller, route, or component js-file:
```javascript
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:
```javascript
return Sugar.Date.full(new Date());
```
### Sugar.js Dates Documentation
[Sugar.js Dates](https://sugarjs.com/dates/#/Usage)
# Collaboration Information
This README outlines the details of collaborating on this Ember add-on.
## Installation
* `git clone git@github.com:cybertoothca/ember-sugar-date-shim.git`
* `cd ember-sugar-date-shim`
### With NPM
```
npm install
```
### With Yarn
```
yarn
```
## Running
* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
## Running Tests
* `npm test` (Runs `ember try:each` to test your add-on against multiple Ember versions)
* `ember test`
* `ember test --server`
## Building
* `ember build`
For more information on using ember-cli, visit [https://ember-cli.com](https://ember-cli.com).
# Linking This Add-on For Local Testing
## Linking
1. From the command line at the root of __this__ project run the
`npm link` command to _link_ this add-on within your local
node repository.
1. From the _other_ Ember project that you wish to test this add-on
in, execute the following command:
`npm link ember-sugar-date-shim`.
1. Now in that same _other_ Ember project, you should go into the
`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.
## Unlinking
1. Remove the add-on from your local node repository with the following
command (that can be run anywhere):
`npm uninstall -g ember-sugar-date-shim`
1. Remove the reference to the `ember-sugar-date-shim`
in your _other_ project's `package.json`.
1. Run an `npm prune` from the root of your _other_ project's command line.