Skip to content

Commit 6252a44

Browse files
fix(grid-column-data-types-sample): remove default timezone setting f… (#3862)
1 parent 8767e3f commit 6252a44

File tree

2 files changed

+7
-25
lines changed

2 files changed

+7
-25
lines changed

src/app/grid/grid-column-data-types-sample/grid-column-data-types-sample.component.html

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,7 @@
4343
<igx-hint>Applied to 'time' type column only</igx-hint>
4444
</igx-select>
4545

46-
<igx-select #select [(ngModel)]="dateTimeOptions.timezone" (selectionChanging)="timezoneSelectionChanging($event)">
47-
<igx-prefix class="ellipsis">Timezone: </igx-prefix>
48-
@for (timezone of timezoneFormats; track timezone) {
49-
<igx-select-item [value]="timezone" [text]="timezone">
50-
{{ timezone }}
51-
</igx-select-item>
52-
}
53-
<igx-hint>Applicable to dateTime type columns only</igx-hint>
54-
</igx-select>
46+
<!-- Timezone selection removed as time-only columns are not timezone-aware -->
5547

5648
<igx-select #select [(ngModel)]="options.currencyCode" (selectionChanging)="currencySelectionChanging($event)">
5749
<igx-prefix class="ellipsis">Currency Code: </igx-prefix>
@@ -109,7 +101,7 @@
109101
[pipeArgs]="formatDateOptions" [dataType]="'date'" [resizable]="true">
110102
</igx-column>
111103
<igx-column field="OrderDateDelay" [width]="'120px'" header="Order Time" [sortable]="true" [hasSummary]="true" [editable]="true"
112-
[pipeArgs]="formatTimeOptions" [dataType]="'time'" [resizable]="true">
104+
[pipeArgs]="formatTimeOptions" [dataType]="'time'" [resizable]="true" [summaries]="IgxTimeSummaryOperand">
113105
</igx-column>
114106
<igx-column field="UnitsInStock" [width]="'120px'" header="Stock Value" [sortable]="true" [hasSummary]="true"
115107
[editable]="true" [pipeArgs]="formatOptions" [dataType]="'currency'" [resizable]="true">

src/app/grid/grid-column-data-types-sample/grid-column-data-types-sample.component.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { IgxHintDirective, IgxInputDirective, IgxInputGroupComponent, IgxPrefixD
1010
import { IgxIconComponent } from 'igniteui-angular/icon';
1111
import { IgxTooltipDirective, IgxTooltipTargetDirective } from 'igniteui-angular/directives';
1212
import { IgxGridComponent } from 'igniteui-angular/grids/grid';
13-
import { IgxColumnComponent } from 'igniteui-angular/grids/core';
13+
import { IgxColumnComponent, IgxTimeSummaryOperand } from 'igniteui-angular/grids/core';
1414
import { FormsModule } from "@angular/forms";
1515
import { IgxPreventDocumentScrollDirective } from "../../directives/prevent-scroll.directive";
1616

@@ -21,6 +21,7 @@ import { IgxPreventDocumentScrollDirective } from "../../directives/prevent-scro
2121
imports: [IgxSelectComponent, FormsModule, IgxPrefixDirective, IgxSelectItemComponent, IgxHintDirective, IgxSuffixDirective, IgxIconComponent, IgxInputGroupComponent, IgxTooltipTargetDirective, IgxTooltipDirective, IgxInputDirective, NgClass, IgxGridComponent, IgxPreventDocumentScrollDirective, IgxColumnComponent]
2222
})
2323
export class GridColumnDataTypesSampleComponent implements OnInit {
24+
public IgxTimeSummaryOperand = IgxTimeSummaryOperand;
2425

2526
public digitsInfoMessage: string = 'Applicable to number, currency and percent type columns';
2627

@@ -58,27 +59,21 @@ export class GridColumnDataTypesSampleComponent implements OnInit {
5859
{ format: "fullTime", eq: "'h:mm:ss a zzzz'"},
5960
];
6061

61-
// Different timezones
62-
public timezoneFormats = ["GMT", "UTC+9:30/ +10:30", "UTC+0", "UTC-6", "UTC+1", "UTC+3" ];
63-
6462
// DateTime options
6563
public dateTimeOptions = {
66-
format: 'long',
67-
timezone: 'UTC+0'
64+
format: 'long'
6865
};
6966
public formatDateTimeOptions = this.dateTimeOptions;
7067

7168
// Date options
7269
public dateOptions = {
73-
format: 'mediumDate',
74-
timezone: 'UTC+0'
70+
format: 'mediumDate'
7571
};
7672
public formatDateOptions = this.dateOptions;
7773

7874
// Time options
7975
public timeOptions = {
80-
format: 'shortTime',
81-
timezone: 'UTC+0'
76+
format: 'shortTime'
8277
};
8378
public formatTimeOptions = this.timeOptions;
8479

@@ -269,11 +264,6 @@ export class GridColumnDataTypesSampleComponent implements OnInit {
269264
this.formatTimeOptions = Object.assign({}, this.formatTimeOptions, this.timeOptions);
270265
}
271266

272-
public timezoneSelectionChanging(event) {
273-
this.dateTimeOptions.timezone = event.newSelection.value;
274-
this.formatDateTimeOptions = Object.assign({}, this.formatDateTimeOptions, this.dateTimeOptions);
275-
}
276-
277267
public currencySelectionChanging(event) {
278268
this.options.currencyCode = event.newSelection.value;
279269
this.formatOptions = Object.assign({}, this.formatOptions, this.options);

0 commit comments

Comments
 (0)