Hot answers tagged

8

Try this: {entry_date format='%F %j'}{if "{entry_date format='%Y%m%d'}" != "{expiration_date format='%Y%m%d'}"}—{expiration_date format='%j'}{/if}, {expiration_date format='%Y'}


7

The dates need to be formatted properly first to compare them. Something like this: {if {business_expire_date format="%U"} < {current_time format="%U"}}class="expired"{/if} You may need to change the comparison operator < to get desired results.


7

The Auto Expire addon should do the trick: http://devot-ee.com/add-ons/auto-expire Auto Expire adds the ability to any weblog to automatically expire new entries. It adds a predefined amount of time to the entry date. If an expiration date has already been set, that date will be used as the expiration date.


5

There are at least three plugins that can format dates like "x time-units ago." Nice Time Time Ago WB Relative Date Since you only need display a relative date for the first two weeks from the entry date, you'll need to wrap your date in a conditional based on {current_time} and use a bit of math. Or as you pointed out in your comment, the Time Ago plugin ...


5

The following conditional will achieve what you want: {if {current_time format="%m"} <= 6} <p>do Jan through June</p> {if:else} <p>do July through December</p> {/if} Edit: Replying to request for March-thru-September date range: Since the %m flag on the date format represents each month as a number (and conveniently one-...


4

Here are two options you could try. Vim Interactive has a date plug-in, DT Plugin, that lets you set the year offset within the plug-in tag itself. Solspace also has a date plug-in called Date Field Filter. To set the offset you require would mean you need to turn on PHP in your templates. I'd recommend trying Vim's plug-in first and see of this solves your ...


4

Since by default the datepicker does not include seconds, EE saves the current time's seconds (minus 1 second) to the entry date (and in fact any custom date field). So the last part of the timestamp for each of these fields is based on when the entry was created. (Looking under the hood, it appears there have been two approaches over the years to this - at ...


4

Check your site's and user profile's localization settings. It's very likely that you're viewing the site in Safari while logged in as a user with a locale that differs from the locale configured for the site. Documentation: Site Localization Settings, Enabling/disabling User-specific Localization


4

Your first 2 tokens are both month tokens. Essentially you're outputting "February February 2013". Try %F %j %Y or %F %d %Y instead. (See PHP date formatting tokens.)


4

So here's what I've found out: EE uses an INT database field to store a UNIX timestamp Because of this, EE can display dates back to about 1901 Switching the database field from INT to BIGINT fixes the problem, but can dramatically increase the size of that database table I discovered the INT vs BIGINT fix through a web search and tested it with success. I ...


4

Inside your Matrix tag pair this will work: {if expiration_date_column > current_time} {!-- not expired yet, put your row html here --} {/if} Or you can use the search parameter on the Matrix opening tag. This is probably better if you only want your result set to include unexpired rows: {your_matrix_field search:expiration_date_column=">{...


4

I thinks is no such function from the box. You can make ext. I made small example for you. This ext. don't have any ui for settings, so you will need to setup what you want in if ($meta['status'] != $status_prev && $meta['status'] == "closed" ) { $this->EE->api_channel_entries->meta['expiration_date'] = $this->EE->localize->...


3

Yep they can. My emphasis: Dates and Times Are Easy in ExpressionEngine 2.6 Dates will still be stored in the database as Unix timestamps for the time being while it offers the best performance advantages under MySQL, so no need to change your add-ons there. But don’t let that stop you entering dates pre-January 1, 1970, ExpressionEngine will handle it just ...


3

You forgot the '' in your tag : <h5>{event_date format=%D, %F %d, %Y}</h5> Correct : <h5>{event_date format='%D, %F %d, %Y'}</h5>


3

I posted this as a bug report to Ellis Lab and followed it up with this comment. I think there is a misunderstanding on the meaning of “European” format. By default the dates are shown as mm/dd/yy - which is a US centric format. Switching to “European” changes the format to yyyy-mm-dd - this is certainly more european but is actually ISO 8601 format I ...


3

I would suggest you to use DropDate field type https://github.com/experience/dropdate.ee_addon/wiki, http://devot-ee.com/add-ons/dropdate


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 ...


3

You're in custom plugin territory Travis. Pretty easy though. Run one (very quick) query to get the latest entry_id in each channel (query exp_channel_titles only). Save them all to an array. Then, you can either return those entry_ids as a variable (concatenated with |), which you pass to your channel:entries tag in your template, or instantiate a new ...


3

Wouldn't you only have to loop through the events on a specific day (today) to see if there is a match for a holiday (and not the entire calendar)? I believe you could use the "Day" loop with a date_range_start of current_time, couldn't you? And since your calendar entries are limited to office holidays, the return of any results for a given day would in ...


3

Creating an "Office Holidays" calendar is a good start. Within that calendar you would create your holiday "events" in the "Calendar: Events" channel. If you're looking to list the upcoming holidays as a list, you can use {exp:calendar:cal}. Don't forget to use calendar_id="" or calendar_name="" is you just want to display events within your "Office ...


3

There wasn't really a question here, but... :) If you're using Solspace Calendar, which I assume you are since you've tagged it as such, you don't have to do this calculation, it's already built into the addon. For instance, you could do this: {exp:calendar:cal date_range_start="{year}-{segment_2}-first" date_range_end="+1 month"}


3

I found this add-on by typing "expressionengine, expiration date required" into Google: http://devot-ee.com/add-ons/required-expiry-date


3

Thanks to @Nevsie-Modeten, I reworked the query to the following: {if {current_time format='%w'} == 0 && {current_time format='%G%i'} >= 930 && {current_time format='%G%i'} <= 1230 } Content to be displayed during this time. {if:else} Content to be displayed during other times. {/if} This checks the day and time and ...


2

Two things to look at: Have your client set an "Expiration Date" on the entries. If show_expired="" is not set to "yes" on the entries tag, then these entries will automatically stop showing on the website at the set time/date. Use the start_on="" parameter to set a start date for the entries tag. Only entries from that date forward to present will show. ...


2

You could create an announcement field along with 2 date fields (start and end dates). {if current_time > announcement_start_time && current_time < announcement_end_time} {announcement} {/if}


2

If it's on the front-end then you can use date variable formatting to output it however you want. To output the dd-mm-yy format you'd just use: {current_time format="%d %m %Y"} The full reference can be found here with some data formatting constants included too. EDIT For the Control panel go to Admin > Localisation settings and set Server Timezone to ...


2

Ian's comment works, though this will be less laborious... Open /system/expressionengine/libraries/Localize.php, and look inside the constructor (around line 53 or so). Comment out the setting of $this->now and change it like so: // Fetch the current local server time and convert it to GMT // $this->now = time(); // Temporarily setting the date to 3 ...


2

As the error says, PHP requires you to set a default timezone. This is actually quite a common error message when setting up a new server (or local development environment) with PHP. You need to find your php.ini file on the server (ask your host where it is, or ask them to edit it for you). Find this part: ; Defines the default timezone used by the date ...


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 ...


2

Turns out it supports the format="" parameter as per ExpressionEngine's documentation: {order_date format="%D, %F %d, %Y - %g:%i:%s"}


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