Hi!
Is there any way to define a date and time instead of just a date? Would like to control the time at which node would expire.

Thanks!
Ricardo

CommentFileSizeAuthor
#11 tm.js_.txt14.77 KBklonos
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brmassa’s picture

Issue tags: -expire

Ricardo,

great. the only problem that i dont know how to include this and use a nice UI javascript (which is not a requirement, i know, but its has a great role on the module success).

so thats the deal: if you can provide some patch, i will take a good look and might commit it. If PHP is not your specialty, i will try to implement this feature one day when get some free time ok?

Anyone else that is available might try this, it is a quite easy job. wont require much coding i think.

regards,

massa

rbl’s picture

Any way to include it without a nice js UI? =)

I can code it myself if you give me a general idea what's involved in it. I really need this feature and I'm willing to sacrifice the UI for the function.

Ricardo

brmassa’s picture

Ricardo,

of course UI is not a requirement. you can build the patch and i will see it for sure. BUT i need a way that admin might disable the time feature (in fact, it should be disabled by default) and should not make any interference on the current UI (should not add any bug).

You might need to add an checkbox option on ntype.inc file and saving it. during nodeapi.inc's validate and submit, as well the form_alter, the time must be considered.

good programming

regards,

massa

brmassa’s picture

note #1: the current code consider the time that the node is created. If the node was created at 9h30, the node will expire at 9h30 at the given date.

note #2: the cron.php should be run on smaller intervals if you enable time, of course.

andrewsuth’s picture

Hi Ricardo,

This is the same feature I was thinking would improve this module a lot. Well done for submitting it and good luck with the development.

I will be interested in knowing how it progresses.

Andrew

Coupon Code Swap’s picture

How about just a simple patch to have nodes expire at the end of the day rather than the beginning? I would like all of the nodes I set to expire to expire at midnight on the day it is set. The way it currently is working, if I set a node to expire on January 2nd, I get an email on January 1st at midnight notifying me that the node has expired via the rules I have set up. Ideally. I'd like to have it expire on midnight of January 2nd (end of day rather than beginning), otherwise it is confusing because I always have to calculate an extra day into the expiration.

Also, sometimes I want to set something to expire at midnight of the current day. Node Expire does not allow me to save the node when I try to do this.

VTM’s picture

And may I add the requirement for flexibility in date format (like in Scheduler - http://drupal.org/project/scheduler)
This may also solve time issues as well.

The only way for changing date format that I found was going into the node_expire.module, where a definition for date format exist.
I changed it to 'd/m/Y' for PHP and 'dd/mm/yy' for Js (the TIME is not important in my case).

On the node form page the display is OK (the default and the Js date - I use this option - are displayed according to the new format)

The problem is:
When saving the node, the Day value is exchanged with the Month value.
Example: for January 8th, 2010 I see on the node form page 08/01/2010, and after saving I see 01/08/2010.
When updating the the fielad (after saving), I see with the Js calander display the wrong date i.e. August 1st.

Another problem I found with the Js interface is:
If a node could not save due to (any) not valid value in the node expiry date field - the Js calander is not displayed anymore.

I'm not a PHP expert so cannot offer solutions.

Thanks.

Coupon Code Swap’s picture

For anyone else grappling with this, I did a little more research and switched back to using the Date module for expiration instead of Node Expire. It has much more flexible date formating and other benefits. I followed the tutorial linked below, modifying it to suit my needs and now I have exactly the functionality I want (it's a bit complex, but worth taking the time to figure it out):

http://drupal.org/node/520012

VTM’s picture

Many thanks !!!
This is what I needed.

klonos’s picture

Version: 6.x-2.02 » 6.x-2.x-dev

...ok just checked this issue and these are my thoughts:

- There should be a checkbox to also display a time picker. Something like 'Also allow setting of expiration time'. This should be a per-content-type setting.

- I looked around for any promising timepickers and I found this one. It allows many configurations like 12/24h format, initial value (default to 'now'), setting the range of selectable hours/minutes, it is themable + more.

people interested in this might want to follow #233047: Switch to using Vega timepicker in the Date module's issue queue.

klonos’s picture

FileSize
14.77 KB

This one is also talked quite a lot, but is far from the 2-clicks approach of the one I mention in #10.

Here are some more for you to check out:

DateTimepicker (last version, support and feature requests seem to be from back in 2008)

Here's a nice date/time picker mod demo page (I am attaching the .js file of this mod here because pages like this one tent to disappear after some time and any effort goes wasted). This mod seems to be based on work originally done by Martin Milesich.

...and another by Jeremy Jongsma.

klonos’s picture

Also this Drupal core issue might be of interest: #51043: Add a "datetime" Form API element, but it got postponed for D8 :(

...although I am not that sure about the use of sliders for time selection.

jvdurme’s picture

So practically, the smallest expiration date/time is 2 days with this module?
You cannot expire something after 5 minutes?

Nafes’s picture

Issue summary: View changes
Status: Active » Fixed

Fixed in 7.x-2.x branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.