Repository navigation
docs(datetime): add range selection playgrounds #4824
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
Open
OS-susmitabhowmik
wants to merge
10
commits into
major-10.0
Choose a base branch
from
ROU-12704-date-range
base: major-10.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9fa3bb0
docs(datetime): add range selection docs and update multiple to use s…
OS-susmitabhowmik 0f5811d
chore(lint): format datetime range and multiple demo files
OS-susmitabhowmik 675ce27
docs(datetime): add full range styling examples with border-radius an…
OS-susmitabhowmik a8564b9
docs(datetime): fix range selection wording to match doc conventions
OS-susmitabhowmik bd8e7b9
fix(datetime): use @ionic/core@9 in range demo files until v10 is pub…
OS-susmitabhowmik 2cccf97
fix(datetime): add size="medium" to range playground components
OS-susmitabhowmik 1efa1e2
fix(datetime): remove border-radius and range-track::before styling r…
OS-susmitabhowmik e54ede6
docs(datetime): simplify range styling section description
OS-susmitabhowmik 4eaf8df
fix(datetime): remove trailing blank lines in range styling demos
OS-susmitabhowmik 49e2b3b
docs(datetime): address PR review feedback for range and multiple sel…
OS-susmitabhowmik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
6 changes: 5 additions & 1 deletion
6
static/usage/v10/datetime/multiple/angular/example_component_html.md
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ```html | ||
| <ion-datetime presentation="date" [multiple]="true" [value]="['2022-06-03', '2022-06-13', '2022-06-29']"></ion-datetime> | ||
| <ion-datetime | ||
| presentation="date" | ||
| selection-mode="multiple" | ||
| [value]="['2022-06-03', '2022-06-13', '2022-06-29']" | ||
| ></ion-datetime> | ||
| ``` |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
3 changes: 3 additions & 0 deletions
3
static/usage/v10/datetime/range/angular/example_component_html.md
This file contains hidden or 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 @@ | ||
| ```html | ||
| <ion-datetime presentation="date" selection-mode="range"></ion-datetime> | ||
| ``` |
12 changes: 12 additions & 0 deletions
12
static/usage/v10/datetime/range/angular/example_component_ts.md
This file contains hidden or 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,12 @@ | ||
| ```ts | ||
| import { Component } from '@angular/core'; | ||
| import { IonDatetime } from '@ionic/angular'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-example', | ||
| templateUrl: 'example.component.html', | ||
| styleUrls: ['./example.component.css'], | ||
| imports: [IonDatetime], | ||
| }) | ||
| export class ExampleComponent {} | ||
| ``` |
This file contains hidden or 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,22 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Datetime</title> | ||
| <link rel="stylesheet" href="../../common.css" /> | ||
| <script src="../../common.js"></script> | ||
| <script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@9/dist/ionic/ionic.esm.js"></script> | ||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@9/css/ionic.bundle.css" /> | ||
| </head> | ||
|
|
||
| <body> | ||
| <ion-app> | ||
| <ion-content> | ||
| <div class="container"> | ||
| <ion-datetime presentation="date" selection-mode="range"></ion-datetime> | ||
| </div> | ||
| </ion-content> | ||
| </ion-app> | ||
| </body> | ||
| </html> |
This file contains hidden or 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,25 @@ | ||
| import Playground from '@site/src/components/global/Playground'; | ||
|
|
||
| import javascript from './javascript.md'; | ||
| import react from './react.md'; | ||
| import vue from './vue.md'; | ||
|
|
||
| import angular_example_component_html from './angular/example_component_html.md'; | ||
| import angular_example_component_ts from './angular/example_component_ts.md'; | ||
|
|
||
| <Playground | ||
| version="10" | ||
|
thetaPC marked this conversation as resolved.
Resolved
|
||
| size="medium" | ||
| code={{ | ||
| javascript, | ||
| react, | ||
| vue, | ||
| angular: { | ||
| files: { | ||
| 'src/app/example.component.html': angular_example_component_html, | ||
| 'src/app/example.component.ts': angular_example_component_ts, | ||
| }, | ||
| }, | ||
| }} | ||
| src="usage/v10/datetime/range/demo.html" | ||
| /> | ||
This file contains hidden or 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 @@ | ||
| ```html | ||
| <ion-datetime presentation="date" selection-mode="range"></ion-datetime> | ||
| ``` |
This file contains hidden or 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 @@ | ||
| ```tsx | ||
| import React from 'react'; | ||
| import { IonDatetime } from '@ionic/react'; | ||
|
|
||
| function Example() { | ||
| return ( | ||
| <> | ||
| <IonDatetime presentation="date" selectionMode="range" /> | ||
| </> | ||
| ); | ||
| } | ||
| export default Example; | ||
| ``` |
This file contains hidden or 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,9 @@ | ||
| ```vue | ||
| <template> | ||
| <ion-datetime presentation="date" selection-mode="range"></ion-datetime> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { IonDatetime } from '@ionic/vue'; | ||
| </script> | ||
| ``` |
10 changes: 10 additions & 0 deletions
10
static/usage/v10/datetime/styling/range/angular/example_component_css.md
This file contains hidden or 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,10 @@ | ||
| ```css | ||
| ion-datetime { | ||
| --range-background: rgb(235, 68, 90, 0.1); | ||
| } | ||
|
|
||
| ion-datetime::part(range-start), | ||
| ion-datetime::part(range-end) { | ||
| background: rgb(235, 68, 90); | ||
| } | ||
| ``` |
3 changes: 3 additions & 0 deletions
3
static/usage/v10/datetime/styling/range/angular/example_component_html.md
This file contains hidden or 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 @@ | ||
| ```html | ||
| <ion-datetime presentation="date" selection-mode="range"></ion-datetime> | ||
| ``` |
12 changes: 12 additions & 0 deletions
12
static/usage/v10/datetime/styling/range/angular/example_component_ts.md
This file contains hidden or 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,12 @@ | ||
| ```ts | ||
| import { Component } from '@angular/core'; | ||
| import { IonDatetime } from '@ionic/angular'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-example', | ||
| templateUrl: 'example.component.html', | ||
| styleUrls: ['./example.component.css'], | ||
| imports: [IonDatetime], | ||
| }) | ||
| export class ExampleComponent {} | ||
| ``` |
This file contains hidden or 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,33 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Datetime</title> | ||
| <link rel="stylesheet" href="../../../common.css" /> | ||
| <script src="../../../common.js"></script> | ||
| <script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@9/dist/ionic/ionic.esm.js"></script> | ||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@9/css/ionic.bundle.css" /> | ||
|
|
||
| <style> | ||
| ion-datetime { | ||
| --range-background: rgb(235, 68, 90, 0.1); | ||
| } | ||
|
|
||
| ion-datetime::part(range-start), | ||
| ion-datetime::part(range-end) { | ||
| background: rgb(235, 68, 90); | ||
| } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <ion-app> | ||
| <ion-content> | ||
| <div class="container"> | ||
| <ion-datetime presentation="date" selection-mode="range"></ion-datetime> | ||
| </div> | ||
| </ion-content> | ||
| </ion-app> | ||
| </body> | ||
| </html> |
This file contains hidden or 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,35 @@ | ||
| import Playground from '@site/src/components/global/Playground'; | ||
|
|
||
| import javascript from './javascript.md'; | ||
|
|
||
| import react_main_tsx from './react/main_tsx.md'; | ||
| import react_main_css from './react/main_css.md'; | ||
|
|
||
| import vue from './vue.md'; | ||
|
|
||
| import angular_example_component_html from './angular/example_component_html.md'; | ||
| import angular_example_component_css from './angular/example_component_css.md'; | ||
| import angular_example_component_ts from './angular/example_component_ts.md'; | ||
|
|
||
| <Playground | ||
| version="10" | ||
| size="medium" | ||
| code={{ | ||
| javascript, | ||
| react: { | ||
| files: { | ||
| 'src/main.tsx': react_main_tsx, | ||
| 'src/main.css': react_main_css, | ||
| }, | ||
| }, | ||
| vue, | ||
| angular: { | ||
| files: { | ||
| 'src/app/example.component.html': angular_example_component_html, | ||
| 'src/app/example.component.css': angular_example_component_css, | ||
| 'src/app/example.component.ts': angular_example_component_ts, | ||
| }, | ||
| }, | ||
| }} | ||
| src="usage/v10/datetime/styling/range/demo.html" | ||
| /> |
This file contains hidden or 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 @@ | ||
| ```html | ||
| <ion-datetime presentation="date" selection-mode="range"></ion-datetime> | ||
|
|
||
| <style> | ||
| ion-datetime { | ||
| --range-background: rgb(235, 68, 90, 0.1); | ||
| } | ||
|
|
||
| ion-datetime::part(range-start), | ||
| ion-datetime::part(range-end) { | ||
| background: rgb(235, 68, 90); | ||
| } | ||
| </style> | ||
| ``` |
This file contains hidden or 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,10 @@ | ||
| ```css | ||
| ion-datetime { | ||
| --range-background: rgb(235, 68, 90, 0.1); | ||
| } | ||
|
|
||
| ion-datetime::part(range-start), | ||
| ion-datetime::part(range-end) { | ||
| background: rgb(235, 68, 90); | ||
| } | ||
| ``` |
This file contains hidden or 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 @@ | ||
| ```tsx | ||
| import React from 'react'; | ||
| import { IonDatetime } from '@ionic/react'; | ||
|
|
||
| import './main.css'; | ||
|
|
||
| function Example() { | ||
| return ( | ||
| <> | ||
| <IonDatetime presentation="date" selectionMode="range" /> | ||
| </> | ||
| ); | ||
| } | ||
| export default Example; | ||
| ``` |
This file contains hidden or 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 @@ | ||
| ```vue | ||
| <template> | ||
| <ion-datetime presentation="date" selection-mode="range"></ion-datetime> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { IonDatetime } from '@ionic/vue'; | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| ion-datetime { | ||
| --range-background: rgb(235, 68, 90, 0.1); | ||
| } | ||
|
|
||
| ion-datetime::part(range-start), | ||
| ion-datetime::part(range-end) { | ||
| background: rgb(235, 68, 90); | ||
| } | ||
| </style> | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we mention that
valueandionChangedon't update until both dates are picked? WithshowDefaultButtonsthe confirm button also stays disabled until then. I think that's the first thing someone listening forionChangewould trip over. Also,valueaccepts[start]as a partial range, which matches the framework'svaluedoc, so "an array of two ISO 8601 strings" is a bit narrower than what it supports.