Skip to content

Instantly share code, notes, and snippets.

@poteto
Last active November 14, 2015 01:38
Show Gist options
  • Save poteto/9006487fb79361992ba5 to your computer and use it in GitHub Desktop.
Save poteto/9006487fb79361992ba5 to your computer and use it in GitHub Desktop.
// 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