Hi, thx for reading my question!
Is it possible to set the default value to count down 30 days in the future? I mean, when the user submits his article, I want to have automatically a countdown of 30 days on the published node, without the user having to select the date.
I use drupal 7.17 and Views. I tried several 'things' in .module and .js, but nothing works and obviously (since I'm not that good in php) I'm doing something very wrong!
Tommy

Comments

Blackice2999’s picture

Hi,

sure you can set a default value in the date field or can use a hook_form_alter to set an specific value. (or hook_field_attach_form) - this is not part of this module.

tds2012’s picture

Thank you for your reply!

set a default value in the date field : yes, i know you can set the default date in the field settings, but suppose I select now in the default setting a date 30 days from now, January 11, won't an article submitted in 3 days also count down to 11 january (instead of January 14)? or does it just add up?

on the other hand, firstly, i get the error
Notice: A non well formed numeric value encountered in field_countdown_field_widget_form() (regel 56 van ..../sites/all/modules/field_countdown/field_countdown.module).
when i try to select the date in the field setting (30 days from now) and it defaults back to 1970-01-01 1:33
so, when trying for a new article, the date field displays 1970-01-01