-
Notifications
You must be signed in to change notification settings - Fork 78
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(date-picker, input-date-picker): add numberingSystem property #5488
Merged
+473
−349
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b292585
feat(date-picker): add numberingSystem property
benelan 8408f06
docs(date-picker): cleanup lang/numberingSystem selection code
benelan 72618d9
feat(input-date-picker): add numberingSystem property [WIP]
benelan e228ec7
add stories
benelan 561456e
cleanup
benelan f49008f
fix spec test
benelan 8cae4ff
cleanup
benelan 158862a
test(date-picker-day): fix failing disabled commonTest
benelan 01be7d3
merge master
benelan 2bef53d
cleanup
benelan 7ec6565
Merge branch 'master' into benelan/4893-date-picker-numbering-system
benelan cad5a3f
Merge branch 'master' into benelan/4893-date-picker-numbering-system
benelan 11fd935
review cleanups
benelan 44c8588
skip (de)localization when formatter is not initialized
benelan 519c826
cleanup and add a spec test
benelan ddb8230
don't init formatter until necessary
benelan 748f79d
Merge branch 'master' into benelan/4893-date-picker-numbering-system
benelan b96a9d3
final cleanup
benelan c605d33
replace stepped stories and change locale to lang
benelan 168b73f
test(input-date-picker): add dark theme class to darkThemeRTL story
benelan 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,11 @@ import { | |
} from "@stencil/core"; | ||
|
||
import { getElementDir } from "../../utils/dom"; | ||
import { DateLocaleData } from "../date-picker/utils"; | ||
import { Scale } from "../interfaces"; | ||
import { CSS_UTILITY } from "../../utils/resources"; | ||
import { InteractiveComponent, updateHostInteraction } from "../../utils/interactive"; | ||
import { isActivationKey } from "../../utils/key"; | ||
import { numberStringFormatter } from "../../utils/locale"; | ||
|
||
@Component({ | ||
tag: "calcite-date-picker-day", | ||
|
@@ -38,7 +38,7 @@ export class DatePickerDay implements InteractiveComponent { | |
//-------------------------------------------------------------------------- | ||
|
||
/** Day of the month to be shown. */ | ||
@Prop() day: number; | ||
@Prop() day!: number; | ||
|
||
/** Date is outside of range and can't be selected */ | ||
@Prop({ reflect: true }) disabled = false; | ||
|
@@ -67,10 +67,6 @@ export class DatePickerDay implements InteractiveComponent { | |
/** Date is actively in focus for keyboard navigation */ | ||
@Prop({ reflect: true }) active = false; | ||
|
||
/** CLDR data for current locale */ | ||
/* @internal */ | ||
@Prop() localeData: DateLocaleData; | ||
|
||
/** specify the scale of the date picker */ | ||
@Prop({ reflect: true }) scale: Scale; | ||
|
||
|
@@ -123,10 +119,7 @@ export class DatePickerDay implements InteractiveComponent { | |
// | ||
//-------------------------------------------------------------------------- | ||
render(): VNode { | ||
const formattedDay = String(this.day) | ||
.split("") | ||
.map((i) => this.localeData.numerals[i]) | ||
.join(""); | ||
const formattedDay = numberStringFormatter.localize(String(this.day)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
const dir = getElementDir(this.el); | ||
return ( | ||
<Host onClick={this.onClick} onKeyDown={this.keyDownHandler} role="gridcell"> | ||
|
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.
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.
🎉