Aug 22, 2017 09:15
lolol
Aug 22, 2017 09:14
@Pseudohuman you don't need to
Aug 22, 2017 09:14
ok thanks @Pseudohuman, it all makes sense now
Aug 22, 2017 09:14
@Pseudohuman who is kenorb?
Aug 22, 2017 09:12
@Pseudohuman where is that?
Aug 22, 2017 09:11
@Pseudohuman where do you live?
 
Jan 18, 2016 16:16
thanks for your time on that Shabir, I appreciate.
Jan 18, 2016 16:10
And that's not possible, it's too messy.
Jan 18, 2016 16:10
Also, the solution above is not going to work on all view modes and all templates, I would have to copy it across my whole codebase, wherever event nodes are rendered.
Jan 18, 2016 16:09
Yes, that's my problem :) Any thoughts on that?
Jan 18, 2016 16:09
But that I need to avoid
Jan 18, 2016 16:09
I'm working with very specific wordings in the template and the HTML has to be specific and following the date.theme's functions. So I would have to replicate everything according to that, e.g. <span class="date-display-start">Tuesday 03 May 2016 - 17:02</span>
Jan 18, 2016 16:07
well as I mention in my initial question, ...Programmatically altering the markup of the field would probably not be a preferred solution as any change of the format on the UI under display settings (e.g. from long to short etc) would be ignored....
Jan 18, 2016 16:06
Oh, and then print $new_formated_date in my template? That's what you mean?
Jan 18, 2016 16:04
I hope everything is more clear now...?
Jan 18, 2016 16:03
So when $content['field_event_date'] goes through render, what's important is the format of the date selected on UI display settings (e.g. "long"), not the value of the date.
Jan 18, 2016 16:03
Yes, I can change the values, ie value & value2 as I like and I can see the change in my dpm. But when the date is rendered (for example on a node page, the template generates the page with that: <?php print render($content['field_event_date']); ?>) and I get the same exact thing.
Jan 18, 2016 16:00
changes the value but not the way the date is rendered. My output is exactly the same as before, not sure if that's what you meant.
Jan 18, 2016 15:59
this:
Jan 18, 2016 15:59
In the meantime...
Jan 18, 2016 15:51
Sorry but this pseudo code can be confusing, especially after trying to solve that for the last few hours!
Jan 18, 2016 15:50
Given the screenshots I showed you, can you give me a real code example of what you mean?
Jan 18, 2016 15:49
Sure
Jan 18, 2016 15:47
I can do whatever I want with value & value2 but I don't know how to override the output on my node basically...
Jan 18, 2016 15:46
So as you can see, value & value2 are what's stored in the db, nothing to do with format.
Jan 18, 2016 15:45
Jan 18, 2016 15:45
and inside $vars['content'], that's what the field contains:
Jan 18, 2016 15:44
that's what I have in my field, dpm straight from preprocess_node
Jan 18, 2016 15:44
Jan 18, 2016 15:42
By the way, updating the module to latest version doesn't add anything to my dpm
Jan 18, 2016 15:41
I mean, within the node object, which value do you set as the format?
Jan 18, 2016 15:41
on the array you're dumping on my question page, to which value do you assign the date / date_format?
Jan 18, 2016 15:39
How do you actually apply that to the stored dates?
Jan 18, 2016 15:39
ok so you assign the desired format to $date_format.
Jan 18, 2016 15:37
what's with the $date_format = date() ?
Jan 18, 2016 15:36
ok so first you get the start and end dates set in the db, that's OK.
Jan 18, 2016 15:34
I need to keep the selected format (which is currently set to "long" on display settings for the default view mode) and just alter the output by presenting just the date, not the time.
Jan 18, 2016 15:34
in date.theme, the theme functions construct the output, e.g. for date range, for single date and so on. This is a different thing than changing the date format e.g. "long", "short" etc.
Jan 18, 2016 15:33
for some nodes (where a checkbox is checked), I need to present the field's output without the time, that's all.
Jan 18, 2016 15:30
I'm using 7.x-2.8, do you think 7.x - 2.9 provides all these attributes? I'll see if it does. In the meantime, value & value2 values never change, no matter the display settings as they correspond the values stored in the dabase (e.g. 2014-04-30 22:30:25). As a result, I'm not sure how I can alter these, which is the base of my problem.
Jan 18, 2016 15:30
I get the exact same thing within $node.
Jan 18, 2016 15:30
In my case, dpm ing $vars only returns value, value2, timezone, timezone_db and date_type. All these are stored in the field's array, under $vars->field_node_date[0]. Any ideas on how to access dateOnly?
Jan 18, 2016 15:30
I had no idea dateOnly can be used like that, so setting it to TRUE would just display the date part excluding the time, no matter the format selected under Display settings? I'll give that a try.
Jan 18, 2016 15:30
Thanks for your suggestion, the date formatting part is the tricky one because of the way the dates are stored within the node object. Can you add an example of how to display the format(s) above?