Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(datepicker): pass current month value to 'markDisabled' callback #849

Merged

Conversation

maxokorokov
Copy link
Member

Small datepicker enhancement: now able to access current month value both in custom template and markDisabled callback.

That allows for instance to disable completely days that are outside of current month and collapse them (see 'custom day view' demo):

[markDisabled]='markDisabled'

...

markDisabled = (date, current: {month: number}) {
  return date.month != current.month;
};

...

<template let-date='date' let-currentMonth='currentMonth'>
  <span [class.hide_day]='date.month !== currentMonth' ...>
</template>

...

.hide_day {
  display: none; // or visibility: hidden; to avoid line collapse
}

Contains an example for #847 and #753

@pkozlowski-opensource
Copy link
Member

LGTM

@maxokorokov maxokorokov merged commit afe6342 into ng-bootstrap:master Oct 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants