@@ -365,6 +365,52 @@ class AtomicCalendarRevive extends LitElement {
365365 margin : auto;
366366 }
367367
368+ ha-button-toggle-group {
369+ color : var (--primary-color );
370+ }
371+
372+ .calTitleContainer {
373+ padding : 0px 8px 8px 8px ;
374+ }
375+
376+ .calIconSelector {
377+ --mdc-icon-button-size : var (--button-toggle-size , 48px );
378+ --mdc-icon-size : var (--button-toggle-icon-size , 24px );
379+ border-radius : 4px 4px 4px 4px ;
380+ border : 1px solid var (--primary-color );
381+ float : right;
382+ display : inline-flex;
383+ text-align : center;
384+ }
385+ .calDateSelector {
386+ --mdc-icon-button-size : var (--button-toggle-size , 48px );
387+ --mdc-icon-size : var (--button-toggle-icon-size , 24px );
388+ display : inline-flex;
389+ text-align : center;
390+ }
391+ div .calIconSelector ha-icon-button , div .calDateSelector ha-icon-button {
392+ color : var (--primary-color );
393+ }
394+ div .calDateSelector .prev {
395+ border : 1px solid var (--primary-color );
396+ border-radius : 3px 0px 0px 3px ;
397+ }
398+ div .calDateSelector .date {
399+ border : 1px solid var (--primary-color );
400+ border-radius : 0px 0px 0px 0px ;
401+ padding : 4px 2px 2px 4px ;
402+ }
403+ div .calDateSelector .next {
404+ border : 1px solid var (--primary-color );
405+ border-radius : 0px 4px 4px 0px ;
406+ }
407+
408+ ha-icon-button {
409+ --mdc-icon-size : 20px ;
410+ --mdc-icon-button-size : 25px ;
411+ color : ${ this . _config . calDateColor } ;
412+ }
413+
368414 table .cal {
369415 margin-left : 0px ;
370416 margin-right : 0px ;
@@ -374,6 +420,14 @@ class AtomicCalendarRevive extends LitElement {
374420 table-layout : fixed;
375421 }
376422
423+ thead th .cal {
424+ color : var (--secondary-text-color );
425+ border : 1px solid ${ this . _config . calGridColor } ;
426+ font-size : 11px ;
427+ font-weight : 400 ;
428+ text-transform : uppercase;
429+ }
430+
377431 td .cal {
378432 padding : 5px 5px 5px 5px ;
379433 border : 1px solid ${ this . _config . calGridColor } ;
@@ -399,12 +453,6 @@ class AtomicCalendarRevive extends LitElement {
399453 width : 100% ;
400454 }
401455
402- ha-icon-button {
403- --mdc-icon-size : 20px ;
404- --mdc-icon-button-size : 25px ;
405- color : ${ this . _config . calDateColor } ;
406- }
407-
408456 .calTableContainer {
409457 width : 100% ;
410458 }
@@ -494,12 +542,6 @@ class AtomicCalendarRevive extends LitElement {
494542 margin-left : -1px ;
495543 }
496544
497- .calDateSelector {
498- display : inline-block;
499- min-width : 9em ;
500- text-align : center;
501- }
502-
503545 .loader {
504546 border : 4px solid # f3f3f3 ;
505547 border-top : 4px solid grey;
@@ -1204,27 +1246,34 @@ class AtomicCalendarRevive extends LitElement {
12041246 getCalendarHeaderHTML ( ) {
12051247 return html `< div class ="calDateSelector ">
12061248 < ha-icon-button
1207- class ="ha-icon-button "
1249+ class ="prev "
12081250 icon ="mdi:chevron-left "
12091251 @click ="${ ( _e ) => this . handleMonthChange ( - 1 ) } "
12101252 title =${ this . hass . localize ( 'ui.common.previous' ) }
12111253 > </ ha-icon-button >
1212- < a
1213- href ="https://calendar.google.com/calendar/r/month/${ moment ( this . selectedMonth ) . format ( 'YYYY' ) } /${ moment (
1214- this . selectedMonth ,
1215- ) . format ( 'MM' ) } /1 "
1216- style ="text-decoration: none; color: ${ this . _config . calDateColor } ; position: relative; top: 4px; "
1217- target ="${ this . _config . linkTarget } "
1218- >
1254+ < span class ="date " style ="text-decoration: none; color: ${ this . _config . calDateColor } ; ">
12191255 ${ moment ( this . selectedMonth ) . format ( 'MMMM' ) } ${ moment ( this . selectedMonth ) . format ( 'YYYY' ) }
1220- </ a >
1256+ </ span >
12211257 < ha-icon-button
1222- class ="ha-icon-button "
1258+ class ="next "
12231259 icon ="mdi:chevron-right "
12241260 @click ="${ ( _e ) => this . handleMonthChange ( 1 ) } "
12251261 title =${ this . hass . localize ( 'ui.common.next' ) }
12261262 > </ ha-icon-button >
1227- </ div > ` ;
1263+ </ div > ` ;
1264+ }
1265+
1266+ showCalendarLink ( ) {
1267+ if ( ! this . _config . disableCalLink ) {
1268+ return html `< div class ="calIconSelector ">
1269+ < ha-icon-button
1270+ icon ="mdi:calendar "
1271+ @click ="https://calendar.google.com/calendar/r/month/${ moment ( this . selectedMonth ) . format ( 'YYYY' ) } /${ moment (
1272+ this . selectedMonth ,
1273+ ) . format ( 'MM' ) } /1 ">
1274+ </ ha-icon-button >
1275+ </ div > `
1276+ }
12281277 }
12291278
12301279 /**
@@ -1286,11 +1335,11 @@ class AtomicCalendarRevive extends LitElement {
12861335 const weekDays = moment . weekdaysMin ( true ) ;
12871336 const htmlDayNames = weekDays . map (
12881337 ( day ) => html `
1289- < th class ="cal " style ="padding-bottom: 8px; color: ${ this . _config . calWeekDayColor } ; "> ${ day } </ th >
1338+ < th class ="cal " style ="color: ${ this . _config . calWeekDayColor } ; "> ${ day } </ th >
12901339 ` ,
12911340 ) ;
12921341 this . content = html `
1293- < div class ="calTitleContainer "> ${ this . getCalendarHeaderHTML ( ) } </ div >
1342+ < div class ="calTitleContainer "> ${ this . getCalendarHeaderHTML ( ) } ${ this . showCalendarLink ( ) } </ div >
12941343 < div class ="calTableContainer ">
12951344 < table class ="cal " style ="color: ${ this . _config . eventTitleColor } ; ">
12961345 < thead >
0 commit comments