-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples(date-range) Create date-range samples #1574
- Loading branch information
1 parent
3185d1c
commit 965fb83
Showing
9 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/app/scheduling/daterange/date-range-formatter/daterange-formatter-sample.component.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,15 @@ | ||
<div class="sample-wrapper date-range-wrapper"> | ||
<h4 class="sample-title">Custom Format Date Range</h4> | ||
<p class="sample-description">Displaying the selected date range in custom format</p> | ||
<div> | ||
<igx-date-range [formatter]="formatter"> | ||
<igx-input-group> | ||
<input #singleInput igxInput igxDateRange type="text"> | ||
<label igxLabel for="singleInput">Input Date</label> | ||
<igx-prefix> | ||
<igx-icon>today</igx-icon> | ||
</igx-prefix> | ||
</igx-input-group> | ||
</igx-date-range> | ||
</div> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
src/app/scheduling/daterange/date-range-formatter/daterange-formatter-sample.component.scss
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,3 @@ | ||
.date-picker-wrapper { | ||
padding: 1rem; | ||
} |
20 changes: 20 additions & 0 deletions
20
src/app/scheduling/daterange/date-range-formatter/daterange-formatter-sample.component.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,20 @@ | ||
import { Component, OnInit } from "@angular/core"; | ||
|
||
@Component({ | ||
selector: "app-daterange-sample", | ||
styleUrls: ["./daterange-formatter-sample.component.scss"], | ||
templateUrl: "./daterange-formatter-sample.component.html" | ||
}) | ||
export class DateRangeFormatterSampleComponent implements OnInit { | ||
private dayFormatter = new Intl.DateTimeFormat("en", { weekday: "long" }); | ||
private monthFormatter = new Intl.DateTimeFormat("en", { month: "long" }); | ||
|
||
constructor() { } | ||
|
||
public formatter = (date: Date) => { | ||
// tslint:disable-next-line:max-line-length | ||
return `${this.dayFormatter.format(date)}, ${date.getDate()} ${this.monthFormatter.format(date)}, ${date.getFullYear()}`; | ||
} | ||
|
||
public ngOnInit(): void {} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/app/scheduling/daterange/simple-date-range/daterange-sample.component.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,15 @@ | ||
<div class="sample-wrapper date-range-wrapper"> | ||
<h4 class="sample-title">Default Date Range</h4> | ||
<p class="sample-description">Plain date range</p> | ||
<div> | ||
<igx-date-range [mode]="'dropdown'"> | ||
<igx-input-group> | ||
<input #singleInput igxInput igxDateRange type="text"> | ||
<label igxLabel for="singleInput">Input Date</label> | ||
<igx-prefix> | ||
<igx-icon>today</igx-icon> | ||
</igx-prefix> | ||
</igx-input-group> | ||
</igx-date-range> | ||
</div> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
src/app/scheduling/daterange/simple-date-range/daterange-sample.component.scss
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,3 @@ | ||
.date-picker-wrapper { | ||
padding: 1rem; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/app/scheduling/daterange/simple-date-range/daterange-sample.component.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 { Component, OnInit, ViewChild } from "@angular/core"; | ||
import { IgxDateRangeComponent } from "igniteui-angular"; | ||
|
||
@Component({ | ||
selector: "app-daterange-sample", | ||
styleUrls: ["./daterange-sample.component.scss"], | ||
templateUrl: "./daterange-sample.component.html" | ||
}) | ||
export class DateRangeSampleComponent implements OnInit { | ||
constructor() { } | ||
|
||
public ngOnInit(): void {} | ||
} |
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