[ 
https://issues.apache.org/jira/browse/GRIFFIN-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16647096#comment-16647096
 ] 

ASF GitHub Bot commented on GRIFFIN-206:
----------------------------------------

Github user chemikadze commented on a diff in the pull request:

    https://github.com/apache/incubator-griffin/pull/435#discussion_r224620459
  
    --- Diff: 
ui/angular/src/app/measure/create-measure/configuration/configuration.component.ts
 ---
    @@ -56,47 +56,47 @@ export class ConfigurationComponent implements OnInit {
       };
       timetypes = ["day", "hour", "minute"];
       timetype: string;
    -  timezones = [
    -    "UTC-12(IDL)",
    -    "UTC-11(MIT)",
    -    "UTC-10(HST)",
    -    "UTC-9:30(MSIT)",
    -    "UTC-9(AKST)",
    -    "UTC-8(PST)",
    -    "UTC-7(MST)",
    -    "UTC-6(CST)",
    -    "UTC-5(EST)",
    -    "UTC-4(AST)",
    -    "UTC-3:30(NST)",
    -    "UTC-3(SAT)",
    -    "UTC-2(BRT)",
    -    "UTC-1(CVT)",
    -    "UTC(WET,GMT)",
    -    "UTC+1(CET)",
    -    "UTC+2(EET)",
    -    "UTC+3(MSK)",
    -    "UTC+3:30(IRT)",
    -    "UTC+4(META)",
    -    "UTC+4:30(AFT)",
    -    "UTC+5(METB)",
    -    "UTC+5:30(IDT)",
    -    "UTC+5:45(NPT)",
    -    "UTC+6(BHT)",
    -    "UTC+6:30(MRT)",
    -    "UTC+7(IST)",
    -    "UTC+8(EAT)",
    -    "UTC+8:30(KRT)",
    -    "UTC+9(FET)",
    -    "UTC+9:30(ACST)",
    -    "UTC+10(AEST)",
    -    "UTC+10:30(FAST)",
    -    "UTC+11(VTT)",
    -    "UTC+11:30(NFT)",
    -    "UTC+12(PSTB)",
    -    "UTC+12:45(CIT)",
    -    "UTC+13(PSTC)",
    -    "UTC+14(PSTD)"
    -  ];
    +  timezones: Map<string, string> = new Map<string, string>([
    +    ["UTC-12(IDL)", "GMT-12"],
    +    ["UTC-11(MIT)", "GMT-11"],
    +    ["UTC-10(HST)", "GMT-10"],
    +    ["UTC-9:30(MSIT)", "GMT-9:30"],
    +    ["UTC-9(AKST)", "GMT-9"],
    +    ["UTC-8(PST)", "GMT-8"],
    +    ["UTC-7(MST)", "GMT-7"],
    +    ["UTC-6(CST)", "GMT-6"],
    +    ["UTC-5(EST)", "GMT-5"],
    +    ["UTC-4(AST)", "GMT-4"],
    +    ["UTC-3:30(NST)", "GMT-3:30"],
    +    ["UTC-3(SAT)", "GMT-3"],
    +    ["UTC-2(BRT)", "GMT-2"],
    +    ["UTC-1(CVT)", "GMT-1"],
    +    ["UTC(WET,GMT)", "GMT"],
    +    ["UTC+1(CET)", "GMT+1"],
    +    ["UTC+2(EET)", "GMT+2"],
    +    ["UTC+3(MSK)", "GMT+3"],
    +    ["UTC+3:30(IRT)", "GMT+3:30"],
    +    ["UTC+4(META)", "GMT+4"],
    +    ["UTC+4:30(AFT)", "GMT+4:30"],
    +    ["UTC+5(METB)", "GMT+5"],
    +    ["UTC+5:30(IDT)", "GMT+5:30"],
    +    ["UTC+5:45(NPT)", "GMT+5:45"],
    +    ["UTC+6(BHT)", "GMT+6"],
    +    ["UTC+6:30(MRT)", "GMT+6:30"],
    +    ["UTC+7(IST)", "GMT+7"],
    +    ["UTC+8(EAT)", "GMT+8"],
    +    ["UTC+8:30(KRT)", "GMT+8:30"],
    +    ["UTC+9(FET)", "GMT+9"],
    +    ["UTC+9:30(ACST)", "GMT+9:30"],
    +    ["UTC+10(AEST)", "GMT+10"],
    +    ["UTC+10:30(FAST)", "GMT+10:30"],
    +    ["UTC+11(VTT)", "GMT+11"],
    +    ["UTC+11:30(NFT)", "GMT+11:30"],
    +    ["UTC+12(PSTB)", "GMT+12"],
    +    ["UTC+12:45(CIT)", "GMT+12:45"],
    +    ["UTC+13(PSTC)", "GMT+13"],
    +    ["UTC+14(PSTD)", "GMT+15"],
    --- End diff --
    
    good catch, thanks


> Wrong sign of time zone offset when created from UI
> ---------------------------------------------------
>
>                 Key: GRIFFIN-206
>                 URL: https://issues.apache.org/jira/browse/GRIFFIN-206
>             Project: Griffin (Incubating)
>          Issue Type: Bug
>            Reporter: Nikolay Sokolov
>            Assignee: Nikolay Sokolov
>            Priority: Major
>
> When job is created from UI, time zone offset is created by this piece of 
> code:
> {code:none}
> let time = new Date().getTimezoneOffset() / 60;
> let timezone = "GMT" + time + ":00";
> {code}
> Problem is, that for GMT-7 it yields positive number, resulting in calculated 
> timezone to be GMT+7.
> Turns out that that some formats are not parsed properly, at least UTCXX:XX 
> format used by UI is not processed correctly, and GMTXX:XX (without signs):
> {code:none}
> scala> java.util.TimeZone.getTimeZone("GMT6")
> res9: java.util.TimeZone = 
> sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
> scala> java.util.TimeZone.getTimeZone("GMT+6")
> res10: java.util.TimeZone = 
> sun.util.calendar.ZoneInfo[id="GMT+06:00",offset=21600000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
> scala> java.util.TimeZone.getTimeZone("UTC+6")
> res11: java.util.TimeZone = 
> sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
> scala> java.util.TimeZone.getTimeZone("UTC-6(CST)")
> res12: java.util.TimeZone = 
> sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to