Last active
November 14, 2015 01:38
-
-
Save poteto/9006487fb79361992ba5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// birth-day/component.js | |
import Ember from 'ember'; | |
import moment from 'moment'; | |
const { | |
Component, | |
computed, | |
get | |
} = Ember; | |
export default Component.extend({ | |
// ... | |
isBirthday: computed('birthDate', { | |
get() { | |
let today = moment(); | |
let birthDate = moment(get(this, 'birthDate')); | |
return (today.month() === birthDate.month()) && | |
(today.day() === birthDate.day()); | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment