-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
72 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
dist/** | ||
tmp/** | ||
build/** | ||
cache/** | ||
node_modules/** | ||
bower_components/** | ||
.sass-cache/** | ||
connect.lock/** | ||
coverage/*/** | ||
libpeerconnection.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +0,0 @@ | ||
[![Build Status](https://travis-ci.org/LocusEnergy/eui-calendar.svg?branch=master)](https://travis-ci.org/LocusEnergy/eui-calendar) | ||
|
||
# Eui-calendar | ||
|
||
This README outlines the details of collaborating on this Ember addon. | ||
|
||
## Installation | ||
|
||
* `git clone` this repository | ||
* `npm install` | ||
* `bower install` | ||
|
||
## Running | ||
|
||
* `ember server` | ||
* Visit your app at http://localhost:4200. | ||
|
||
## Running Tests | ||
|
||
* `npm test` (Runs `ember try:testall` to test your addon against multiple Ember versions) | ||
* `ember test` | ||
* `ember test --server` | ||
|
||
## Building | ||
|
||
* `ember build` | ||
|
||
For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/). | ||
|
||
|
||
Questions / TODO: | ||
- remove 'eui' prefix from the internal components? | ||
- add warning if moment isn't defined in each selector? (for example: `return momentDecade(this.get('decade'), 'YYYY')` in year-selector) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Ember from 'ember'; | ||
import layout from '../templates/components/eui-selectdate'; | ||
import Moment from 'moment'; | ||
|
||
const { | ||
computed | ||
} = Ember; | ||
|
||
let EUISelectdateComponent = Ember.Component.extend({ | ||
layout, | ||
tagName: 'eui-selectdate', | ||
placeholder: 'Select a date', | ||
didReceiveAttrs() { | ||
this._super(...arguments); | ||
this.set('_date', this.get('date') || Moment()); | ||
}, | ||
nextMonth: computed('_date', function(){ | ||
return this.get('_date').clone().add(1, 'month'); | ||
}), | ||
actions: { | ||
open() { | ||
this.set('isOpen', true); | ||
}, | ||
next(date) { | ||
this.set('_date', date.clone().add(1, 'month')); | ||
}, | ||
previous(date) { | ||
this.set('_date', date.clone().subtract(1, 'month')); | ||
}, | ||
select(date) { | ||
this.sendAction('on-select', date); | ||
} | ||
} | ||
}); | ||
|
||
EUISelectdateComponent.reopenClass({ | ||
positionalParams: ['date'] | ||
}); | ||
|
||
export default EUISelectdateComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<button class="eui-selectdate--trigger" {{action 'open'}}>{{if date (moment-format date 'MMMM D') placeholder}}</button> | ||
|
||
{{#if isOpen}} | ||
<div class="eui-selectdate--window"> | ||
<button class="eui-selectdate--next" {{action 'next' _date}}>>></button> | ||
<button class="eui-selectdate--previous" {{action 'previous' _date}}><<</button> | ||
<div class="eui-selectdate--current-month"> | ||
<div class="eui-selectdate--current-month-name">{{moment-format _date 'MMMM YYYY'}}</div> | ||
{{eui-day-selector _date on-select='select'}} | ||
</div> | ||
<div class="eui-selectdate--next-month"> | ||
<div class="eui-selectdate--next-month-name">{{moment-format nextMonth 'MMMM YYYY'}}</div> | ||
{{eui-day-selector nextMonth on-select='select'}} | ||
</div> | ||
</div> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'eui-calendar/components/eui-selectdate'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"compilerOptions":{"target":"es6","experimentalDecorators":true}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<h4>eui-calendar</h4> | ||
|
||
{{eui-calendar}} | ||
|
||
{{eui-selectdate}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters