-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datepicker): add ability to show one month for daterangepicker d…
…epend on max/min date value (#5667) * feat(datepicker): add ability to show one month for daterangepicker, depends on max/min date value * fix(tests): change moment.js format for the Datepicker tests * fix(code): delete space * fix(docs): fix format issue in doc Co-authored-by: dmitry-zhemchugov <[email protected]>
- Loading branch information
1 parent
d785e71
commit b405057
Showing
9 changed files
with
86 additions
and
8 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
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
21 changes: 21 additions & 0 deletions
21
...app/components/+datepicker/demos/daterangepicker-display-one-month/display-one-month.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,21 @@ | ||
<div class="row"> | ||
<div class="col-xs-12 col-12 col-sm-6 col-md-6 form-group"> | ||
<p><code>maxDate</code> is today</p> | ||
<input class="form-control" | ||
placeholder="Daterangepicker" | ||
ngModel | ||
bsDaterangepicker | ||
[maxDate]="today" | ||
[bsConfig]="{ dateInputFormat: 'DD-MM-YYYY', displayOneMonthRange: true }"> | ||
</div> | ||
<div class="col-xs-12 col-12 col-sm-6 col-md-6 form-group"> | ||
<p><code>minDate</code> month is equal to <code>maxDate</code> month</p> | ||
<input class="form-control" | ||
placeholder="Daterangepicker" | ||
ngModel | ||
bsDaterangepicker | ||
[minDate]="minDate" | ||
[maxDate]="maxDate" | ||
[bsConfig]="{ dateInputFormat: 'DD-MM-YYYY', displayOneMonthRange: true }"> | ||
</div> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
...c/app/components/+datepicker/demos/daterangepicker-display-one-month/display-one-month.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,17 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-daterangepicker-display-one-month', | ||
templateUrl: './display-one-month.html' | ||
}) | ||
export class DemoDateRangePickerDisplayOneMonth { | ||
today: Date; | ||
maxDate: Date; | ||
minDate: Date; | ||
|
||
constructor() { | ||
this.today = new Date(); | ||
this.minDate = new Date(this.today.getFullYear(), this.today.getMonth(), 2); | ||
this.maxDate = new Date(this.today.getFullYear(), this.today.getMonth(), 25); | ||
} | ||
} |
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