Drupal Version: 4.7
Date module version: 4.7.x-1.6
CCK module version: 4.7.x-1.3

type of field: date
widget: text
tz option: no
multiple: no
required: no

Hi,

at one time (I can't remember de module version then), I had set granularity to YMD and, If I entered only '2002-03', it would be padded with zeroes for the inexistent part.

I'd then check for this in the theme and only showed the valid (non-zero) values... that is, I'd show '12/03/2002' (if the value was 2002-03-12) or '03/2002' (if the value was '2002-03-00').

The problem is that at some point this got somehow 'fixed' and now, if I don't save a valid 'YYYY-MM-DD' date, it'd either put a NULL value or the current date.

A few tests shows that if I only enter 'YYYY' it uses the current date, and if I enter 'YYYY-MM' it leaves a NULL value.

I don't know if this is a bug or a feature :-) but I'd sure like it to be like it was before, 'cause I'm losing data from this field when editing the node (even if I don't touch the date field).

I browsed date.inc a bit, but I can't understand how $granularity is used to filter this stuff when using text field input.

Any help would be greatly appreciated.

Comments

el_baby’s picture

FWIW, bumping up CCK to the current 4.7.x-1.5-1 didn't change a thing, everything keeps working like I said above...

The most curious thing is the different behavior when I enter 'YYYY' or when I enter 'YYYY-MM'.

choster’s picture

Status: Active » Closed (duplicate)

As feature development on 4.7 has stopped and there's a longer thread requesting fuzzy granularity at http://drupal.org/node/259308 , I'm going to mark this as a duplicate.