Custom Date/Time attribute resets

Permalink
I have a custom attribute for a date/time using the text entry method.

When the page is saved, the date reverts to Dec 31, 1969 and the time switches to 7pm (or maybe it was 4pm... definitely not the date I entered).

This is odd because the date/time show on the page properties screen in what I assume is the correct format. Then when the page is saved they reset.

Could this be a bug?

kirkroberts
 
RadiantWeb replied on at Permalink Reply
RadiantWeb
I am pretty sure you need to strtotime() that on entry.

C
kirkroberts replied on at Permalink Reply
kirkroberts
Thanks for your reply, Chad.
I think you're talking about printing the date to the page.
I'm talking about strictly within the c5 edit mode and the custom attributes panel.
The date/time changes on its own, like it isn't finding the value and is defaulting around epoch time. Very odd.
RadiantWeb replied on at Permalink Reply
RadiantWeb
It sounds like you are trying to format the date for input, but the data is being inserted to your server format.

I noticed when coding simple addons I had to keep the formatting going "in" a specific format, which led me to having to strtotime() every date coming out.
kirkroberts replied on at Permalink Reply
kirkroberts
More and more this feels like a bug.
Here are more specifics and how to replicate the issue:

Enter date/time using text entry as "6pm" (date is irrelevant for my purposes).
Save page. Time shows as expected on page.

Go into edit mode. Date/time show as:
6:00:00 PM on 4/19/2010 (the date the attribute was edited... c5 has created this string from my "6pm" entry)
Save page. Time shows as expected.

Go into edit mode. Date/time reset to:
4:00:00 PM on 12/31/1969 (always that time and date, no matter what time/date was originally added)

What's odd is that c5 is creating the date/time string which is then being misinterpreted. What I'm entering doesn't seem to affect the results.
Ricalsin replied on at Permalink Reply
Ricalsin
I am trying to pass a date string from a c5 table to the DOM in order to use javascript on it as a counter. As mentioned above, I don't want to take out the c5 formatting and strtotime everything. But if I just send the c5 date as is the js interprets it as Dec...1969. I'm thinking the problems are related and I am hoping you can help with a solution you found.

Thanks, Rick
kirkroberts replied on at Permalink Reply
kirkroberts
I used the date/time type instead of text entry and it has been working fine.

Good luck!
Ricalsin replied on at Permalink Reply
Ricalsin
deleted