Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdcd1373

Browse files
authored
Merge pull requestlowcoder-org#1162 from MenamAfzal/add/timezone-name
Added TimeZoneName in JSON return Object in TimeZone
2 parents4ae6762 +68be43e commitdcd1373

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

‎client/packages/lowcoder/src/comps/comps/dateComp/dateComp.tsx‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -462,13 +462,16 @@ export const dateRangeControl = (function () {
462462
.build();
463463
})();
464464

465-
constgetTimeZoneInfo=(timeZone:any,othereTimeZone:any)=>{
466-
consttz=timeZone==='UserChoice' ?othereTimeZone :timeZone;
467-
return{
468-
TimeZone:tz,
469-
Offset:dayjs().tz(tz).format('Z')// Get the UTC offset for the selected timezone
470-
};
471-
};
465+
constgetTimeZoneInfo=(timeZone:any,otherTimeZone:any)=>{
466+
consttz=timeZone==='UserChoice' ?otherTimeZone :timeZone;
467+
468+
constdateInTz=dayjs().tz(tz);
469+
constoffset=dateInTz.format('Z');
470+
consttimeZoneName=newIntl.DateTimeFormat('en-US',{timeZone:tz,timeZoneName:'short'})
471+
.formatToParts().find(part=>part.type==='timeZoneName')?.value;
472+
473+
return{TimeZone:tz,Offset:offset,Name:timeZoneName};
474+
};
472475

473476
exportconstDatePickerComp=withExposingConfigs(datePickerControl,[
474477
depsConfig({

‎client/packages/lowcoder/src/comps/comps/dateComp/timeComp.tsx‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,16 @@ export const timeRangeControl = (function () {
414414
.build();
415415
})();
416416

417-
constgetTimeZoneInfo=(timeZone:any,othereTimeZone:any)=>{
418-
consttz=timeZone==='UserChoice' ?othereTimeZone :timeZone;
419-
return{
420-
TimeZone:tz,
421-
Offset:dayjs().tz(tz).format('Z')// Get the UTC offset for the selected timezone
422-
};
423-
};
417+
constgetTimeZoneInfo=(timeZone:any,otherTimeZone:any)=>{
418+
consttz=timeZone==='UserChoice' ?otherTimeZone :timeZone;
419+
420+
constdateInTz=dayjs().tz(tz);
421+
constoffset=dateInTz.format('Z');
422+
consttimeZoneName=newIntl.DateTimeFormat('en-US',{timeZone:tz,timeZoneName:'short'})
423+
.formatToParts().find(part=>part.type==='timeZoneName')?.value;
424+
425+
return{TimeZone:tz,Offset:offset,Name:timeZoneName};
426+
};
424427

425428
exportconstTimePickerComp=withExposingConfigs(timePickerControl,[
426429
newNameConfig("value",trans("export.timePickerValueDesc")),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp