Skip to content

Commit 2098806

Browse files
fix(datetime): ascending order for years (#27551)
resolves #27422 Co-authored-by: Jón Prüßmeier <jon-pruessmeier@users.noreply.github.com> --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Years in the date picker are displayed in descending order. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Years in the date picker are displayed in ascending order - This matches the native behavior ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> This is not a breaking change, but it may be unexpected and also may cause users' visual diff tests to fail. As such, we'll target this to 7.1 ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> The updated snapshots show the change --------- Co-authored-by: ionitron <hi@ionicframework.com>
1 parent af92cb2 commit 2098806

File tree

105 files changed

+4
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4
-4
lines changed

core/src/components.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ export namespace Components {
947947
*/
948948
"value"?: string | string[] | null;
949949
/**
950-
* Values used to create the list of selectable years. By default the year values range between the `min` and `max` datetime inputs. However, to control exactly which years to display, the `yearValues` input can take a number, an array of numbers, or string of comma separated numbers. For example, to show upcoming and recent leap years, then this input's value would be `yearValues="2024,2020,2016,2012,2008"`.
950+
* Values used to create the list of selectable years. By default the year values range between the `min` and `max` datetime inputs. However, to control exactly which years to display, the `yearValues` input can take a number, an array of numbers, or string of comma separated numbers. For example, to show upcoming and recent leap years, then this input's value would be `yearValues="2008,2012,2016,2020,2024"`.
951951
*/
952952
"yearValues"?: number[] | number | string;
953953
}
@@ -4973,7 +4973,7 @@ declare namespace LocalJSX {
49734973
*/
49744974
"value"?: string | string[] | null;
49754975
/**
4976-
* Values used to create the list of selectable years. By default the year values range between the `min` and `max` datetime inputs. However, to control exactly which years to display, the `yearValues` input can take a number, an array of numbers, or string of comma separated numbers. For example, to show upcoming and recent leap years, then this input's value would be `yearValues="2024,2020,2016,2012,2008"`.
4976+
* Values used to create the list of selectable years. By default the year values range between the `min` and `max` datetime inputs. However, to control exactly which years to display, the `yearValues` input can take a number, an array of numbers, or string of comma separated numbers. For example, to show upcoming and recent leap years, then this input's value would be `yearValues="2008,2012,2016,2020,2024"`.
49774977
*/
49784978
"yearValues"?: number[] | number | string;
49794979
}

core/src/components/datetime/datetime.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export class Datetime implements ComponentInterface {
231231
* the year values range between the `min` and `max` datetime inputs. However, to
232232
* control exactly which years to display, the `yearValues` input can take a number, an array
233233
* of numbers, or string of comma separated numbers. For example, to show upcoming and
234-
* recent leap years, then this input's value would be `yearValues="2024,2020,2016,2012,2008"`.
234+
* recent leap years, then this input's value would be `yearValues="2008,2012,2016,2020,2024"`.
235235
*/
236236
@Prop() yearValues?: number[] | number | string;
237237
@Watch('yearValues')

0 commit comments

Comments
 (0)