Skip to content

Commit 67ee3c1

Browse files
authored
Merge pull request #847 from utmstack/bugfix/v10.5.8/replace-timezone-names-with-GMT-offsets
Bugfix/v10.5.8/replace timezone names with gmt offsets
2 parents fcab523 + 0ffce9b commit 67ee3c1

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

frontend/src/app/shared/components/utm/config/app-config-sections/app-config-sections.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ <h6 class="font-weight-semibold mb-2">{{section.section | titlecase}}</h6>
103103
[loadingText]="'Loading Timezones...'"
104104
[loading]="!timezones"
105105
groupBy="zone"
106-
bindLabel="label"
107106
bindValue="timezone"
108107
[(ngModel)]="conf.confParamValue"
109108
id="timezoneSetting">
109+
<ng-template ng-option-tmp ng-label-tmp let-item="item">
110+
({{ item.timezone | timezoneOffset }}) {{ item.label }}
111+
</ng-template>
110112

111113
</ng-select>
112114

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Pipe, PipeTransform } from '@angular/core';
2+
import * as moment from 'moment-timezone';
3+
4+
@Pipe({
5+
name: 'timezoneOffset'
6+
})
7+
export class TimezoneOffsetPipe implements PipeTransform {
8+
9+
transform(timezone: string): string {
10+
console.log(timezone);
11+
const offset = moment.tz(timezone).format('Z'); // Obtener offset como +02:00
12+
return `GMT${offset}`; // Concatenar con 'GMT'
13+
}
14+
15+
}

frontend/src/app/shared/utm-shared.module.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ import {SafePipe} from './pipes/safe.pipe';
217217
import {HighlightPipe} from './pipes/text/highlight.pipe';
218218
import {UtmNotifier} from './websocket/utm-notifier';
219219
import {UtmCollectorDetailComponent} from './components/utm/util/utm-collector-detail/utm-collector-detail.component';
220+
import {TimezoneOffsetPipe} from './pipes/timezone-offset.pipe';
220221

221222

222223
@NgModule({
@@ -356,7 +357,8 @@ import {UtmCollectorDetailComponent} from './components/utm/util/utm-collector-d
356357
ZoomDirective,
357358
IrVariableCreateComponent,
358359
IncidentVariableSelectComponent,
359-
EmailSettingNotificactionComponent
360+
EmailSettingNotificactionComponent,
361+
TimezoneOffsetPipe
360362
],
361363
exports: [
362364
IndexPatternCreateComponent,
@@ -449,7 +451,8 @@ import {UtmCollectorDetailComponent} from './components/utm/util/utm-collector-d
449451
UtmVersionInfoComponent,
450452
IrVariableCreateComponent,
451453
IncidentVariableSelectComponent,
452-
EmailSettingNotificactionComponent
454+
EmailSettingNotificactionComponent,
455+
TimezoneOffsetPipe
453456
],
454457
entryComponents: [
455458
LoginComponent,

version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 10.5.8
1+
version: 10.5.9

0 commit comments

Comments
 (0)