Created
July 22, 2016 11:39
-
-
Save HusseinMorsy/9665b1a0b7038721740e4e5f3a60a64a to your computer and use it in GitHub Desktop.
ember-pikaday-demo
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
import Ember from 'ember'; | |
import moment from 'moment'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
availableDates: [ | |
new Date(2016,6,25), | |
new Date(2016,6,27), | |
new Date(2016,6,29) | |
], | |
availableDatesStr: Ember.computed('availableDates.@each', function() { | |
return this.get('availableDates').map((date)=> moment(date).format()); | |
}), | |
actions: { | |
disableDay(day) { | |
/* für die include methode sollte die array elemente arrays sein | |
ansonstens funktioniert der vergleich nicht korrekt */ | |
let availableDates = this.get('availableDatesStr'); | |
return !availableDates.includes(moment(day).format()); | |
} | |
} | |
}); |
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
{ | |
"version": "0.10.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.6.0", | |
"ember-data": "2.6.1", | |
"ember-template-compiler": "2.6.0" | |
}, | |
"addons": { | |
"ember-pikaday": "2.1.0", | |
"ember-cli-moment-shim": "1.1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment