DateFormat

Hi I don’t know how to format data, I try to convert data what I’m doing it wrong :blush:

I’m using this event to add events into Db

[code]scheduler.attachEvent(“onEventAdded”, function(id){
var ev = scheduler.getEvent(id);
ev.estado=“anadir”;
var convert = scheduler.date.str_to_date("%Y-%m-%d %H:%i:%s%",true);

		 $.post("datafeed_post.php",ev, function(ev){
			alert("Data Loaded: " + ev);
			});
		 
		 return true;
	});

[/code]

But when I catch start_date of end_data I recibe this format:

Wed Dec 01 2010 04:55:00 GMT +0100 (CET)

What I need to do to convert to 12/01/2010 04:55:00??? thanks :wink:

Hello,

Check out following links:
Date formats
Settings format

Best regards,
Ilya

Can you give me a example of use? I don’t understand how I have to use it, thanks.

Hello,

var convert = scheduler.date.str_to_date("%Y-%m-%d %H:%i:%s%",true);

Here you are creating only a function named convert which will convert string into the date object according to the specified format. You don’t convert anything yet.

To convert date object to the string you need to create another function and convert date itself:

var convert = scheduler.date.date_to_str("%Y/%m/%d %H:%i:%s", true); var converted_date = convert(ev.start_date);
Now converted_date variable stores a string in the specified above format made from the ev.start_date date object.

Hope this helps.

Best regards,
Ilya