
By koyra on
I have site with drupal 4.5 and module flexinode. This module flexinode can create field datetime format. How I can change format of type flexinode field datetime to DAY/MONTH/YEAR?
I have site with drupal 4.5 and module flexinode. This module flexinode can create field datetime format. How I can change format of type flexinode field datetime to DAY/MONTH/YEAR?
Comments
Brute-force hack to change flexinode date/time display
Hi...
Still a newbie to drupal, so apologies if this ignores best practice; tried searching for a solution & reading docs (the most nearly applicable, http://drupal.org/node/9700, didn't seem to be quite on point.)
This is my first modification to a module, so I'll warn in advance to use at your own risk, and invite both friendly corrections and irate "WTF are you doing" replies.
Tested with flexinode v 1.46.2.2 and drupal 4.6.3.
-john
Flexinode appears to default to the medium date format. If you can live with the same date format throughout drupal, you can make a few changes, first to define a new user format:
system.module, line 258
and then, specify the formatting your addition as a function in common.inc
common.inc, line 852
edit the switch block beginning at line 865 to reflect that 'medium' is no longer the default and provide a new case statement for your format
common.inc, line 875
You should then be able to go to admin/settings and select your choice of m/d/y arrangements; these should then appear immediately on any timestamped flexinodes.
Now you need to make some changes in the flexinode's own timestamp functions to modfy how it displays edit boxes and concatenates them for conversion to a timestamp.
In field_timestamp.inc, locate the flexinode_form_date function, then make the following changes:
field_timestamp.inc comment out lines 74-76 (unneeded display formatting)
field_timestamp.inc comment out lines 83-89 (suppress edit boxes)
field_timestamp.inc remove the hour/minute conditions from line 97
field_timestamp.inc hardcode 12 noon into the gmmktime function on line 107
THANKS
THANKS
Thank you, this is just what
Thank you, this is just what I was looking for! :-)
--
Sverre Sverresonn
Group Scout Leader
21st Medway Scouts, Kent, UK
http://www.21stmedway.org.uk/