Hot answers tagged

3

I hear what you're saying about automating but in reality just how many holidays do you honour? It's not going to take too long to do it manually. I would create a channel for holidays and create an entry for each holiday with the entry and expiration dates set. Then on your template use a channel entries tag pair with show_future_entries="no" In theory ...


2

Carefully "unescape" the variables you want to be cached, so e.g. {stash:nocache} <div> {if {current_time format="%U"} - {/stash:nocache}{event_time format="%U"}{stash:nocache} < -86400} {/stash:nocache}{facebook_link}{stash:nocache} {/if} {if {current_time format="%U"} - {/stash:nocache}{event_time format="%U"}{stash:nocache} < 86400 &...


2

Try making this a global variable in your config file, then you can do all the date checking in PHP. Go to http://www.epochconverter.com/ and get the start and end date of when you're closed, then add this to your config.php file. if (time() > 1387497600 && time() < 1388016000) { // Use this in your template {hours_open} and it'll show if ...


1

AFAIK there is no automatic way to do this kind of time zone adjustment in EE. EE stores times relative to the server's location timezone, or relative a different timezone if you specify it in the CP. Dynamically modifying the server's default timezone on the fly is not a sensible option, so whatever you do will require you to modify the times shown to the ...


1

You're on the right track, but no bracing and formatting is needed; date variables will output timestamps without formatting, and comparisons can be made properly between integer types. So you can use a simpler: {if (current_time - child_dob) >= 63072000} Do this {if:else} Do That {/if}


1

jrothafer's troubleshooting suggestion will tell you a lot. If that looks good, try putting the tags in single quotes like so: {if '{current_time format="%h"}' >= '{branch_hours:opening_hour}' && '{current_time format="%h"}' <= '{branch_hours:closing_hour}' } <span class="open-now text-right">Open Now</span> {/if}


Only top voted, non community-wiki answers of a minimum length are eligible