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'}


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

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

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


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

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

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

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

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

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

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

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

Turn off the DST thing, make sure admin is the desired timezone and base all new members on admins timezone. Or just use @lows nice date plugin.


2

I believe, your options are: to change the format of date you're using on the segment_2, which isn't a good idea because EllisLab can some day finally normalize all date fields; to reformat the date to match the way its used on edit_date database column; To change the date format, I suggest you the Low Nice Date plugin: {exp:low_nice_date date="{segment_2}...


2

The start_on="2010-01-01 00:00" parameter should do the trick... "You can specify a particular date/time on which to start the entries. Only entries that are on or after this date will be included in the display. This parameter is often used together with the stop_before= parameter for limiting the entry display to a specific date range."


2

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


2

You can try to use search: parameter with combination with {current_time}* {my_matrix_field search:date=">{current_time"}"} usually date fields is keep data in timestamp format, so it must work. Unlike the rest of the Standard Global Variables, {current_time} is parsed very early on in the Template parser, which allows you to make dynamic use of it in ...


2

You could enable php, grab the current time and add as much time as you need, then use the start_on parameter. Or here's a plugin you could use: http://devot-ee.com/add-ons/dt-plugin Maybe something like this as the start_on parameter: {exp:dt day="7" ee_format="true" format="%Y-%m-%d %H:%i"}


2

You could do this: {if '{entry_date format="%Y%m%d"}' == '{current_time format="%Y%m%d"}'}Today, {/if}{entry_date format="%F %j, %Y"}


1

You can search to see if there are any rows which have a current or future date, then proceed accordingly: {if '{calendar:total_rows search:date=">={current_time}"}' > 0} Your calendar is outdated {if:else} {calendar} {if "{date format='%Y%m%d'}" == "{current_time format='%Y%m%d'}"} <information here> {if} ...


1

You would have to prevent default to stop the existing datepicker opening on input click. You could then use jQuery UI datepicker to add your own datepicker and customise it.


1

I came across this post while attempting to solve a similar problem; hopefully this will be helpful to others who need the same functionality in the future. Event Helper is a plugin that comes with a field type that allows for a simple date formatting WITHOUT a time stamp that can be used in GRID and MATRIX. The actual Event Helper extension still needs to ...


1

Can you simply remove the timestamp after the fact with something like CE String? Or, don't use the EE date field at all. Set up your own custom field, use a javscript calendar like jQuery UI Datepicker, and then you can format it exactly as you like.


1

i cant add comments yet, so i add an answer. maybe cp-css-js from pixel and tonic, can help you out. by adding some javascript validation on the expiration date field example: $("#expiration_date").prop("required","required");


1

Issue is definitely the formatting. I tested this locally and found that the format you used returns FALSE when it's passed to the strtotime() method. This because PHP cannot recognize the format to convert it to a timestamp, thus returning FALSE which will force the email to be sent immediately. Use the following format: {parcel:expiration_date format="%Y/%...


1

I believe what might be happening is that the JavaScript for the datepicker is being added to the page multiple times, by each loop through the channel entries tag. There is a parameter for the channel form tag include_assets="no" which will prevent it from adding the Javascript, so perhaps you could use that with a conditional to only output the assets on ...


1

Currently, the Range filter only targets custom channel fields. If you want to target the entry_date, you can use the native start_on and stop_before parameters. If you do, make sure the values are formatted as stated in the EE docs, so something like: <input name="start_on" value="2014-01-01 00:00"> <input name="stop_before" value="2014-01-24 23:...


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