Skip to content
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-time-picker): add time label i18n #1760

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/witty-geese-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@siemens/ix-angular": minor
"@siemens/ix": minor
"@siemens/ix-vue": minor
---

__ix-datetime-picker__: Time selection headline can now be translated via property `i18nTime`.
4 changes: 2 additions & 2 deletions packages/angular/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,14 +686,14 @@ Only triggered if date-picker-rework is in range mode. @since 2.1.0


@ProxyCmp({
inputs: ['dateFormat', 'eventDelimiter', 'from', 'i18nDone', 'locale', 'maxDate', 'minDate', 'range', 'showHour', 'showMinutes', 'showSeconds', 'showTimeReference', 'textSelectDate', 'time', 'timeFormat', 'timeReference', 'to', 'weekStartIndex']
inputs: ['dateFormat', 'eventDelimiter', 'from', 'i18nDone', 'i18nTime', 'locale', 'maxDate', 'minDate', 'range', 'showHour', 'showMinutes', 'showSeconds', 'showTimeReference', 'textSelectDate', 'time', 'timeFormat', 'timeReference', 'to', 'weekStartIndex']
})
@Component({
selector: 'ix-datetime-picker',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['dateFormat', 'eventDelimiter', 'from', 'i18nDone', 'locale', 'maxDate', 'minDate', 'range', 'showHour', 'showMinutes', 'showSeconds', 'showTimeReference', 'textSelectDate', 'time', 'timeFormat', 'timeReference', 'to', 'weekStartIndex'],
inputs: ['dateFormat', 'eventDelimiter', 'from', 'i18nDone', 'i18nTime', 'locale', 'maxDate', 'minDate', 'range', 'showHour', 'showMinutes', 'showSeconds', 'showTimeReference', 'textSelectDate', 'time', 'timeFormat', 'timeReference', 'to', 'weekStartIndex'],
})
export class IxDatetimePicker {
protected el: HTMLElement;
Expand Down
27 changes: 27 additions & 0 deletions packages/core/component-doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6031,6 +6031,33 @@
"optional": false,
"required": false
},
{
"name": "i18nTime",
"type": "string",
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"mutable": false,
"attr": "i-1-8n-time",
"reflectToAttr": false,
"docs": "Top label of time picker",
"docsTags": [
{
"name": "since",
"text": "3.0.0"
}
],
"default": "'Time'",
"values": [
{
"type": "string"
}
],
"optional": false,
"required": false
},
{
"name": "locale",
"type": "string | undefined",
Expand Down
10 changes: 10 additions & 0 deletions packages/core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,11 @@ export namespace Components {
* @since 2.1.0
*/
"i18nDone": string;
/**
* Top label of time picker
* @since 3.0.0
*/
"i18nTime": string;
/**
* Format of time string See {@link "https://moment.github.io/luxon/#/formatting?id=table-of-tokens"} for all available tokens.
* @since 2.1.0
Expand Down Expand Up @@ -6122,6 +6127,11 @@ declare namespace LocalJSX {
* @since 2.1.0
*/
"i18nDone"?: string;
/**
* Top label of time picker
* @since 3.0.0
*/
"i18nTime"?: string;
/**
* Format of time string See {@link "https://moment.github.io/luxon/#/formatting?id=table-of-tokens"} for all available tokens.
* @since 2.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ export class DatetimePicker
*/
@Prop({ attribute: 'i18n-done' }) i18nDone: string = 'Done';

/**
* Top label of time picker
*
* @since 3.0.0
*/
@Prop() i18nTime: string = 'Time';

/**
* The index of which day to start the week on, based on the Locale#weekdays array.
* E.g. if the locale is en-us, weekStartIndex = 1 results in starting the week on monday.
Expand Down Expand Up @@ -252,6 +259,7 @@ export class DatetimePicker
showSeconds={this.showSeconds}
onTimeChange={(event) => this.onTimeChange(event)}
format={this.timeFormat}
textTime={this.i18nTime}
time={this.time}
></ix-time-picker>
<div class="btn-select-date-container">
Expand Down
1 change: 1 addition & 0 deletions packages/vue/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ export const IxDatetimePicker = /*@__PURE__*/ defineContainer<JSX.IxDatetimePick
'timeReference',
'textSelectDate',
'i18nDone',
'i18nTime',
'weekStartIndex',
'locale',
'eventDelimiter',
Expand Down
Loading