admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Quintiq file version 2.0
#parent: #root
Method ShowTimeZoneWarning (
  internal[WebImage] imgWarning_i,
  TimeZone calendarTimezone_i,
  Boolean isFromEvent_i
) id:Method_LibCal_GlobalState_ShowTimeZoneWarning
{
  #keys: '[146730.0.1175922411]'
  Body:
  [*
    // Only show when running in timezone-mode.
    visible := TimeZone::HasTimeZoneSupport() and
               ApplicationScope.SupportsTimezone();
    
    if( visible )
    {
      // Only show the warning when the timezone-offset of the calendar is different from the
      // offset of the local timezone of the Client.
      calendarOffset := calendarTimezone_i.RawOffset();
      localTimezone  := LibCal_GlobalState.GetLocalTimeZone();
      localOffset    := localTimezone.RawOffset();
      
      visible := localOffset <> calendarOffset;
      
      if( visible )
      {
        calendarOffsetAsString := "GMT" + ifexpr( calendarOffset >= Duration::Zero(), "+", "" ) + calendarTimezone_i.RawOffset().Format( "h2:m" );
        localOffsetAsString    := "GMT" + ifexpr( localOffset    >= Duration::Zero(), "+", "" ) + localTimezone     .RawOffset().Format( "h2:m" );
        
        if( isFromEvent_i )
        {
          imgWarning_i.Tooltip( Translations::Timezone_WarningEvent( calendarTimezone_i.ID(), calendarOffsetAsString,
                                                                     localTimezone.ID(), localOffsetAsString ) );
        }
        else
        {
          imgWarning_i.Tooltip( Translations::Timezone_WarningSettings( calendarTimezone_i.ID(), calendarOffsetAsString,
                                                                        localTimezone.ID(), localOffsetAsString ) );
    
        }
      }
    }
    
    imgWarning_i.Visible( visible );
  *]
}