6:00 PM to 6 PM #125
Replies: 11 comments 12 replies
-
Beta Was this translation helpful? Give feedback.
-
ugh...that had no effect |
Beta Was this translation helpful? Give feedback.
-
What did you do and what happened? |
Beta Was this translation helpful? Give feedback.
-
so i followed what you said in the above post. didnt have any effect so i started trying some things and nothing worked Aside from Teslamate and a problem with what appears to be the Mosquitto Broker I have everything working pretty well. Just want to iron out the rest of these calendar tweaks. and somehow my legend turned red, not sure where that happened? once i launch MM the calendar doesnt usually show up populated so i need the refresh and then it populates. **this is my first time (obvioulsy) making one of these so its been a lot of learning on the fly so some of my solutions may nto be very elegant. Thanks again for the help config.js /* MagicMirror² Config Sample
{
},
{
}
{
}, /*************** DO NOT EDIT THE LINE BELOW ***************/ MMM-CalendarExt3.css /* stylelint-disable .CX3 { font-size: var(--fontsize); .CX3 * { .CX3_MAGIC { .CX3.bodice { .CX3 .week { .CX3 .weekGrid { .CX3 .weekGridRow { .CX3 .cellContainer { .CX3 .eventContainer { .CX3 .cell { .CX3 .cell.hasMore::after { .CX3 .cellHeader { .CX3 .cellFooter { .CX3 .cellBody { .CX3 .cw { .CX3 .cw:not(.cwFirst) { .CX3 .cw::before { .CX3 .cellContainer .cell:nth-child(1) .cw { .CX3 .cell.today { .CX3 .today .cellDate { .CX3 .thisMonth { .CX3 .cellDate .literal { .CX3 .cellDate :not(.day) { .CX3 .today .cellDate :not(.day) { .CX3 .date_1 .cellDate :not(.day) { .CX3 .week:nth-child(2) .cell:first-child .cellDate * { .CX3 .event { .CX3 .event .headline { .CX3 .event .headline .title.marquee { .CX3 .event .headline .title.marquee .marqueeText { @Keyframes marquee { 49.999% { 50% { 50.001% { 60% { 100% { .CX3 .event .time { .CX3 .event .headline .title { .CX3 .event .headline .symbol { .CX3 .event .headline .time { .CX3 .event.fullday, .CX3 .event.singleday .headline:not(.useSymbol)::before, .CX3 .event .headline:not(.useSymbol) .symbol { .CX3 .event .headline.useSymbol .symbol { .CX3 .event.singleday .headline.useSymbol .symbol { .CX3 .event.fullday .headline .time { .CX3 .event.singleday .headline .time { .CX3 .event.multiday .headline .startTime { .CX3 .event .time.notInDay { .CX3 .event .time.endTime { .CX3 .event:not(.fullday) .headline .time.endTime { .CX3 .event .startTime::after { .CX3 .event .startTime.notInDay + .endTime.inDay::before { .CX3 .event.continueFromPreviousWeek .headline .time { .CX3 .event.multiday:not(.continueToNextWeek) .headline .endTime { .CX3 .event .description, .CX3 .event.passed { .CX3 .event.current { .CX3 .weekend { .CX3 .weekend_2 { .CX3 .weekend_1 { .CX3 .cellHeader .cellDate { .CX3 .cellHeader .cellWeather { .CX3 .cellHeader .cellWeather .icon { .CX3 .cellHeader .cellWeather .maxTemp { .CX3 .cellHeader .cellWeather .minTemp { .CX3 .cellHeader .cellWeather .temperature { .CX3 .cellHeader .cellWeather .maxTemp::before { .CX3 .cellHeader .cellWeather .minTemp::before { .CX3 .cellHeader .cellWeather .temperature::after { .CX3 .legends { .CX3 .legends .legend { .CX3 .legend.useSymbol .symbol { /* popover */ #CX3_POPOVER { #CX3_POPOVER[popover] { #CX3_POPOVER:popover-open { #CX3_POPOVER::backdrop { @Keyframes slideIn { 100% { #CX3_POPOVER .header { #CX3_POPOVER .header[data-is-fullday="true"] { #CX3_POPOVER .header[data-is-fullday="false"] { #CX3_POPOVER .content { #CX3_POPOVER .content .name { #CX3_POPOVER .content .value { /* text-wrap: balance; */ /* Expreimental for CSS Text Module Level 4 */ #CX3_POPOVER .content .list { #CX3_POPOVER .content .eventItem { #CX3_POPOVER .eventItem { #CX3_POPOVER .eventItem .symbol { #CX3_POPOVER .eventItem .title { #CX3_POPOVER .eventItem .time { #CX3_POPOVER .eventItem .full { custom.css
/* Uncomment and adjust accordingly if you want to import another font from the google-fonts-api: / body { :root { --font-primary: "Roboto Condensed"; --font-size: 20px; --gap-body-top: 60px; --gap-modules: 30px; .module-header { /* Set the font size for the MMM-NHL module header / /make the event name the calendar color/ /* changes all the text color to match nice - but only use without the background borders*/ /gives everthing a background color - nice/ .MMM-WOTD header {
.wotd-title { .wotd-summary {
} .wotd-examples {
} } .MMM-History { .MMM-Dad-Jokes .bright.light.small { } } .MMM-QuoteCatalog .bright.small.light {
} } MMM-CalendaerExt3.js const popoverSupported = (typeof HTMLElement !== 'undefined') ? HTMLElement.prototype.hasOwnProperty('popover') : false
}, defaulNotifications: { getStyles: function () { getMoment: function (options) { regularizeConfig: function (options) {
}, start: function() {
}, preparePopover: function () {
}, dayPopover(cDom, events, options) {
}, eventPopover: function (eDom) {
}, activatePopover: function (popover) { notificationReceived: function (notification, payload, sender) {
}, getDom: function () {
}, updated: function (dom, options) { draw: async function (dom, options) {
}, getHeader: function () { updateAnimate: function () { |
Beta Was this translation helpful? Give feedback.
-
Wow, to make things simple;
Let’s talk from then. |
Beta Was this translation helpful? Give feedback.
-
thanks so it still takes a reload to populate the calendar. not a huge deal but noteworthy i havent configured any other modules so everything else is default or just sits on "loading" /* MagicMirror² Config Sample
module: "MMM-CalendarExt3", } /*************** DO NOT EDIT THE LINE BELOW ***************/ |
Beta Was this translation helpful? Give feedback.
-
progress **tried to turn off times like you suggested to change 9:00 to 9 .CX3 .event.singleday .headline .time { .CX3 .customTime { |
Beta Was this translation helpful? Give feedback.
-
I was on holiday, sorry for the late return.
{
module: "MMM-CalendarExt3",
position: "bottom_bar",
title: "",
config: {
mode: "month",
eventTransformer: (event) => {
if (event.fullDayEvent) return event
let time = new Date(+event.startDate)
let timeFormat = (time.getMinutes() === 0) ? { hour: 'numeric', hour12: true } : { hour: 'numeric', minute: '2-digit', hour12: true }
let timeStr = time.toLocaleTimeString(['en-US'], timeFormat)
event.title = `<span class="customTime">${timeStr}</span>` + event.title
return event
}
}
}, If work, progress from here. |
Beta Was this translation helpful? Give feedback.
-
that's awesome! but the time are not right justifying |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Here's my solution. At some point I may clean it up into a pull request. CX3_shared.mjs @@ -257,11 +257,26 @@ const renderEventAgenda = (event, {useSymbol, eventTimeOptions, locale, useIconi
let startTime = document.createElement('div')
let st = new Date(+event.startDate)
startTime.classList.add('time', 'startTime', (st.getDate() === tm.getDate()) ? 'inDay' : 'notInDay')
- startTime.innerHTML = new Intl.DateTimeFormat(locale, eventTimeOptions).formatToParts(st).reduce((prev, cur, curIndex, arr) => {
+ /*startTime.innerHTML = new Intl.DateTimeFormat(locale, eventTimeOptions).formatToParts(st).reduce((prev, cur, curIndex, arr) => {
prev = prev + `${cur.value}`
return prev
- }, '')
- headline.appendChild(startTime)
+ }, '')*/
+
+ let brieftime = "";
+ let hrs = st.getHours();
+ if (hrs > 12) { hrs -= 12 };
+ if (st.getMinutes() === 0) {
+ brieftime = `${hrs}`;
+ } else {
+ brieftime = `${hrs}:${st.getMinutes()}`;
+ }
+ if (st.getHours() > 11) {
+ brieftime = `${brieftime}p`;
+ } else {
+ brieftime = `${brieftime}a`;
+ }
+ startTime.innerHTML = brieftime;
+ headline.appendChild(startTime);
let endTime = document.createElement('div')
let et = new Date(+event.endDate)
|
Beta Was this translation helpful? Give feedback.
-
Is there a way to display the times on the hour without the minute zeroes?
So the events would look like
12:30 PM
1:30 PM
3 PM
4 PM
5:30 PM
thanks
Beta Was this translation helpful? Give feedback.
All reactions