File tree Expand file tree Collapse file tree
library/Notifications/Widget/TimeGrid Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,13 +66,13 @@ public function assemble(): void
6666 $ time = new DateTime ();
6767 $ dayTimestamps = [];
6868 for ($ i = 0 ; $ i < $ timestampPerDay ; $ i ++) {
69- // am-pm is separated by non-breaking whitespace
70- $ parts = preg_split ( ' /\s/u ' , $ dateFormatter -> format ( $ time -> setTime ( $ i * $ timeIntervals , 0 )));
71-
72- $ stamp = [ new HtmlElement ( ' span ' , null , new Text ( $ parts [ 0 ]))];
73- if ( isset ( $ parts [ 1 ])) {
74- $ stamp [] = new HtmlElement ( ' span ' , null , new Text ( $ parts [ 1 ]));
75- }
69+ $ stamp = array_map (
70+ function ( $ part ) {
71+ return new HtmlElement ( ' span ' , null , new Text ( $ part ));
72+ },
73+ // am-pm is separated by non-breaking whitespace
74+ preg_split ( ' /\s/u ' , $ dateFormatter -> format ( $ time -> setTime ( $ i * $ timeIntervals , 0 )))
75+ );
7676
7777 $ dayTimestamps [] = new HtmlElement ('span ' , new Attributes (['class ' => 'timestamp ' ]), ...$ stamp );
7878 $ dayTimestamps [] = new HtmlElement ('span ' , new Attributes (['class ' => 'ticks ' ]));
Original file line number Diff line number Diff line change 7474
7575 .timescale {
7676 display : grid ;
77- grid-template-columns : repeat (~ " calc(var(--primaryColumns) * var(--timestampsPerDay))" , minmax (0 ,1fr ));
77+ grid-template-columns : repeat (
78+ ~ " calc(var(--primaryColumns) * var(--timestampsPerDay))" ,
79+ minmax (~ " calc(var(--minimumPrimaryColumnWidth) / var(--timestampsPerDay))" , 1fr )
80+ );
81+
7882 border-left : 1px solid @gray-lighter ; // this is required to maintain the grid layout
7983 grid-area : ~ " 4 / 2 / 4 / 3" ;
8084
100104 align-items : center ;
101105 margin-top : 0.5em ;
102106 padding-top : 0.5em ;
103- font-size : .5 em ;
107+ font-size : .75 em ;
104108 position : relative ;
105109 left : -50% ;
106110 line-height : 1 ;
114118 }
115119 }
116120
117- span :nth- last- of- type(2 ), // last .ticks before .midnight
118- .midnight {
121+ > span .ticks :nth- last- of- type(2 ), // last .ticks and .midnight
122+ > .timestamp .midnight {
119123 grid-area : ~ " 1 / -2 / 1 / -1" ;
120124 }
121125 }
122126
123127 .clock {
124128 display : grid ;
125- grid-template-columns : repeat (var (--primaryColumns ), 1fr );
129+ grid-template-columns : repeat (var (--primaryColumns ), minmax ( var ( --minimumPrimaryColumnWidth ), 1fr ) );
126130 grid-area : ~ " 3 / 2 / 4 / 3" ;
127131 border-top : 1px solid transparent ; // left not required, otherwise the .time-hand is not aligned properly
128132
129133 .current-day {
130134 display : grid ;
131- grid-template-columns : repeat (var (--columnsPerStep ), 1fr );
135+ grid-template-columns : repeat (var (--columnsPerStep ), minmax ( var ( --minimumStepColumnWidth ), 1fr ) );
132136 grid-area : ~ " 1 / 1 / 2 / 2" ;
133137
134138 .time-hand {
You can’t perform that action at this time.
0 commit comments