I'm having trouble getting dates to display correctly on my site, although I notice that they display perfectly in the Drupal preview function while editing a post. Does anyone know the default way of coding dates -- or the code for the Drupal editing display?

Thank you.

Comments

nevets’s picture

You are likely to get more help if you explain the problem, though if you are using Drupal 8 since it is still in development the number of people who could help are limited.

finallyadrupaluser’s picture

Thank you. It's actually a Drupal 7 problem; that was my mistake.

The problem is complicated, but I believe the answer is simple (but beyond my knowledge). In short, the variables the previous developer used are returning incomplete and incorrect dates. The developer seems to be doing some kind of transformation of the date fields that generates this problem. However, the date and time are returned correctly in the preview area of the edit area in the administration section. So, for example, when I select "Preview," all of the information I entered, including the Start Date and End Date, display correctly, even through they don't when I use the code on the live website. If I could just figure out what Drupal's default preview date display code (or some other basic Drupal date display code), I could use a modified version of the code for the site.

Does that make sense?

Thank you.

nevets’s picture

You are still being vague about the problem, how is the date display wrong, what is wrong?

finallyadrupaluser’s picture

I'm sorry. I am being vague about the details of the problem because I don't want to "fix" the code that is producing the error. Instead, I want to *replace* that code with the default edit preview in the administration section, or something similar. In other words, from my perspective, a productive conversation would be about how dates are typically displayed in Drupal, and I want to ignore the previous coders' mistakes. Does that make sense?