[TH] Holidays

[TH] Holidays 2.1.3

No permission to download
If you go into the styling tab you can remove the avatar effect.

Code:
.avatar {
    position: relative;

    &::before {
        content:"";
        display: block;
        background-image: url('styles/themehouse/holidays/new-years/mask.svg');
        background-size: contain;
        background-repeat: no-repeat;
        width: 150%;
        height: 150%;
        position: absolute;
    }
}
 
I did remove something I shouldn't in the New Year options
(when I was trying to remove the masks)
So I just have the fireworks, nothing more.

Can someone please copy the whole script (just the styling) for the New Year options? 😊
 
First of all, thank you for this very great addon!! (y)(y)(y)

I did it a differnet way. Mask should only be until 00.00 hours and then off. So I created a copy of New Year and named it Old Year. After that I set the times in both pieces and removed the masks in the New Year option.

@Nordgard this is the full New Year styling:
Code:
.node-icon i:before {
    content: "_" !important;
    text-indent: -9999 !important;
    color: transparent !important;
}

.node-icon i {
    span {
        background-color: transparent !important;
        color: transparent !important;
        text-shadow: none !important;
    }
    background-image: url('styles/themehouse/holidays/new-years/firework-muted.png');
    background-size: contain;
    background-repeat: no-repeat;
}

.node--unread.node--category .node-icon i,
.node--unread.node--forum .node-icon i {
    background-image: url('styles/themehouse/holidays/new-years/firework.png');
}

.p-body-pageContent {
    .block--category {
        .block-header {
            position: relative;

            a {
                z-index: 5;
                position: relative;
            }
        }

        &:first-child {
            .block-header {
                &::after {
                    content: "";

                    position: absolute;
                    top: 4px;
                    right: 3px;
                    z-index: 2;

                    pointer-events: none;

                    background-image: url('styles/themehouse/holidays/new-years/flag_streamer.svg');
                    background-size: contain;
                    background-repeat: no-repeat;

                    transform: rotate(30deg);

                    width: 40px;
                    height: 40px;
                }
            }

            .block-body {
                position: relative;

                &::after {
                    content: "";

                    position: absolute;
                    bottom: -11px;
                    right: -13px;

                    pointer-events: none;

                    background-image: url('styles/themehouse/holidays/new-years/ball_bell.svg');
                    background-size: contain;
                    background-repeat: no-repeat;

                    transform: rotate(-30deg);

                    width: 20px;
                    height: 20px;
                }
            }
        }
    }
}

.avatar {
    position: relative;

    &::before {
        content:"";
        display: block;
        background-image: url('styles/themehouse/holidays/new-years/mask.svg');
        background-size: contain;
        background-repeat: no-repeat;
        width: 150%;
        height: 150%;
        position: absolute;
    }
}
 
I've found a bug. It seems for dates, it's also looking for year, in spite of the fact that no year is given/configured.

If you have the Winter holiday and set it from for example 15-12 to 10-01 it should run every year from 15-12 to 10-01. However, at 01-01 there is a new year and it stops working unless you set the begin date at 01-01.

So you can set the end date to what you want, it will stop automatically at 01-01 anyway. So it is checking the year instead of only month and day and this is causing this bug.
 
I've found a bug. It seems for dates, it's also looking for year, in spite of the fact that no year is given/configured.

If you have the Winter holiday and set it from for example 15-12 to 10-01 it should run every year from 15-12 to 10-01. However, at 01-01 there is a new year and it stops working unless you set the begin date at 01-01.

So you can set the end date to what you want, it will stop automatically at 01-01 anyway. So it is checking the year instead of only month and day and this is causing this bug.
Thank you for the report here and in ticket, I've gone ahead and got this added to our issue tracker :)
 
First of all, thank you for this very great addon!! (y)(y)(y)

I did it a differnet way. Mask should only be until 00.00 hours and then off. So I created a copy of New Year and named it Old Year. After that I set the times in both pieces and removed the masks in the New Year option.

@Nordgard this is the full New Year styling:
Code:
.node-icon i:before {
    content: "_" !important;
    text-indent: -9999 !important;
    color: transparent !important;
}

.node-icon i {
    span {
        background-color: transparent !important;
        color: transparent !important;
        text-shadow: none !important;
    }
    background-image: url('styles/themehouse/holidays/new-years/firework-muted.png');
    background-size: contain;
    background-repeat: no-repeat;
}

.node--unread.node--category .node-icon i,
.node--unread.node--forum .node-icon i {
    background-image: url('styles/themehouse/holidays/new-years/firework.png');
}

.p-body-pageContent {
    .block--category {
        .block-header {
            position: relative;

            a {
                z-index: 5;
                position: relative;
            }
        }

        &:first-child {
            .block-header {
                &::after {
                    content: "";

                    position: absolute;
                    top: 4px;
                    right: 3px;
                    z-index: 2;

                    pointer-events: none;

                    background-image: url('styles/themehouse/holidays/new-years/flag_streamer.svg');
                    background-size: contain;
                    background-repeat: no-repeat;

                    transform: rotate(30deg);

                    width: 40px;
                    height: 40px;
                }
            }

            .block-body {
                position: relative;

                &::after {
                    content: "";

                    position: absolute;
                    bottom: -11px;
                    right: -13px;

                    pointer-events: none;

                    background-image: url('styles/themehouse/holidays/new-years/ball_bell.svg');
                    background-size: contain;
                    background-repeat: no-repeat;

                    transform: rotate(-30deg);

                    width: 20px;
                    height: 20px;
                }
            }
        }
    }
}

.avatar {
    position: relative;

    &::before {
        content:"";
        display: block;
        background-image: url('styles/themehouse/holidays/new-years/mask.svg');
        background-size: contain;
        background-repeat: no-repeat;
        width: 150%;
        height: 150%;
        position: absolute;
    }
}
Thank you so much! :)
 
Seems I found another bug. Not sure where Holidays is looking/checking for the date.
But I set Eastern to the 17th, which is today, but the Holiday mod started working already yesterday the 16th.

Timezone and time on both server and php are set correctly and also shown correctly on the forums.
 
Some Holidays like Easter are worked out automatically if they vary each year, Easter has its own callback using a PHP function to determine when it is. Probably not very clear from the settings it does that but holidays like Easter are automatic.
 
Yea it has always done this. It changes holidays based on UK time, not your local time setting. (so 5am where I live, in eastern USA)

My fix was to modify the cron to run at 1:05am daily, to switch over closer to the correct time (or closer during daylight savings)
 
but holidays like Easter are automatic.
Yes so why can you set a start date then? Anyway, if it's automatic, then it certainly did not start correctly this year. :)
With UK time it should start 1 hour earlier, not 24 hours earlier, because Netherlands only differs 1 hour with the UK. Or am I missing something?

My fix was to modify the cron to run at 1:05am daily,
I doubt that this would fix a 24 hour mistake.
 

It uses a core PHP function to determine the date Easter is, so if this returns Saturday the 16th for 2022, then that’d be a PHP bug, as we can only go on what that returns.

PHP:
public static function easter(Holiday $holiday)
{
    $time = self::getTime();
    $start = (Carbon::createFromTimestamp(easter_date($time->year)))->startOfDay();
    $end = (clone($start))->addWeek()->endOfDay();

    return $time->between($start, $end);
}
 
It uses a core PHP function
Ah ok. I don't realy have php knowledge, but I found this on php.net:

Note:

easter_date() relies on your system's C library time functions, rather than using PHP's internal date and time functions. As a consequence, easter_date() uses the TZ environment variable to determine the time zone it should operate in, rather than using PHP's default time zone, which may result in unexpected behaviour when using this function in conjunction with other date functions in PHP.

As a workaround, you can use the easter_days() with DateTime and DateInterval to calculate the start of Easter in your PHP time zone as follows:

I don't know if that might be helpfull to you.

Anyway, thanks for the quick response. Still happy with this addon. And it's not a very big thing, now we can celebrate 3 days instead of 2. :D
 
It's coded to be enabled all week - to be honest I'm not sure why that is as I didn't build it but that's how it's currently set up. You can disable thw holiday for now to stop it being applied.
 
Top Bottom