Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datepicker): export NgbDatepickerMonthView
- Loading branch information
1 parent
ddc4ceb
commit 3b82948
Showing
23 changed files
with
710 additions
and
481 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
14 changes: 14 additions & 0 deletions
14
demo/src/app/components/datepicker/demos/custommonth/datepicker-custommonth.html
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,14 @@ | ||
<p>This datepicker uses a custom month layout.</p> | ||
|
||
<ngb-datepicker #dp | ||
[startDate]="{month: 8, year: 2016}" | ||
[displayMonths]="2" | ||
[outsideDays]="'collapsed'" | ||
[navigation]="'none'"> | ||
<ng-template ngbDatepickerMonths> | ||
<div class="custom-month-view" *ngFor="let monthStruct of dp.state.months"> | ||
<span>{{i18n.getMonthFullName(monthStruct.month)}} {{monthStruct.year}}</span> | ||
<ngb-datepicker-month [month]="monthStruct"></ngb-datepicker-month> | ||
</div> | ||
</ng-template> | ||
</ngb-datepicker> |
13 changes: 13 additions & 0 deletions
13
demo/src/app/components/datepicker/demos/custommonth/datepicker-custommonth.module.ts
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,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; | ||
|
||
import { NgbdDatepickerCustommonth } from './datepicker-custommonth'; | ||
|
||
@NgModule({ | ||
imports: [BrowserModule, NgbModule], | ||
declarations: [NgbdDatepickerCustommonth], | ||
exports: [NgbdDatepickerCustommonth], | ||
bootstrap: [NgbdDatepickerCustommonth] | ||
}) | ||
export class NgbdDatepickerCustommonthModule {} |
27 changes: 27 additions & 0 deletions
27
demo/src/app/components/datepicker/demos/custommonth/datepicker-custommonth.ts
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,27 @@ | ||
import {Component} from '@angular/core'; | ||
import {NgbDatepickerI18n} from '@ng-bootstrap/ng-bootstrap'; | ||
|
||
@Component({ | ||
selector: 'ngbd-datepicker-custommonth', | ||
templateUrl: './datepicker-custommonth.html', | ||
styles: [` | ||
ngb-datepicker { | ||
display: flex; | ||
border: none; | ||
} | ||
.custom-month-view { | ||
margin: 1rem; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
border: 1px solid gray; | ||
border-radius: 1rem 1rem 0 0; | ||
} | ||
.custom-month-view span{ | ||
font-weight: bold; | ||
} | ||
`] | ||
}) | ||
export class NgbdDatepickerCustommonth { | ||
constructor(public i18n: NgbDatepickerI18n) {} | ||
} |
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
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
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
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
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
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
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
Oops, something went wrong.