Skip to content

Commit

Permalink
Improve GT views with more details
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvc committed Oct 3, 2023
1 parent 47c88a4 commit 55921e9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
14 changes: 14 additions & 0 deletions repository/ZTimestamp-GT/ZSubTimezone.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Extension { #name : #ZSubTimezone }

{ #category : #'*ZTimestamp-GT' }
ZSubTimezone >> gtViewDetailsIn: composite [
<gtView>
^ composite columnedList
title: 'Details';
items: [ {('abbreviation' -> self abbreviation).
('offset' -> self offset).
('daylight saving' -> self isDaylightSaving) } ];
column: 'Key' text: #key;
column: 'Value' text: #value;
send: #value
]
1 change: 1 addition & 0 deletions repository/ZTimestamp-GT/ZTimestamp.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ZTimestamp >> gtViewDetailsIn: composite [
^ composite columnedList
title: 'Details';
items: [ {('iso' -> self printString).
(ZTimezone current id asLowercase -> (ZTimestampFormat isoNanoTZ useCurrentTimezone; format: self)).
('year' -> self year).
('month' -> self monthIndex).
('month name' -> self monthName).
Expand Down
26 changes: 22 additions & 4 deletions repository/ZTimestamp-GT/ZTimezone.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,29 @@ ZTimezone class >> gtViewCachedTimezonesFor: aView [
tooltip: 'Search cached timezones by id'
]

{ #category : #'*ZTimestamp-GT' }
ZTimezone class >> gtViewCurrentTimezoneIn: composite [
<gtView>
<gtClassView>
^ composite columnedList
title: 'Default';
priority: 11;
items: [ {('image default' -> self current id)} ];
column: 'Key' text: #key;
column: 'Value' text: #value;
send: [ self current ]
]

{ #category : #'*ZTimestamp-GT' }
ZTimezone >> gtViewDetailsIn: composite [
<gtView>
^ composite columnedList
title: 'Details';
items: [ {('id' -> self id).
('now' -> (ZTimestampFormat isoNanoTZ timezone: self; format: ZTimestamp now)).
('current offset' -> (self offsetForTimestamp: ZTimestamp now)).
('current subzone' -> (self subzoneForTimestamp: ZTimestamp now)) } ];
('currently daylight saving' -> (self subzoneForTimestamp: ZTimestamp now) isDaylightSaving).
('current subzone' -> (self subzoneForTimestamp: ZTimestamp now) description ) } ];
column: 'Key' text: #key;
column: 'Value' text: #value;
send: #value
Expand Down Expand Up @@ -126,7 +141,10 @@ ZTimezone >> gtViewTransitionsIn: composite [
^ composite columnedList
title: 'Transitions';
items: [ self resolvedTransitions ];
column: 'Start' text: #key;
column: 'Subzone' text: #value;
send: #value
column: 'Start absolute' text: [ :association | association key ];
column: ('Start ' , self id)
text: [ :association | ZTimestampFormat isoTZ timezone: self; format: association key ];
column: ('Start ' , ZCurrentTimezone value id)
text: [ :association | ZTimestampFormat isoTZ useCurrentTimezone; format: association key ];
column: 'Subzone' text: [ :association | association value description ]
]

0 comments on commit 55921e9

Please sign in to comment.