Date formating Questions

Hello over there,

i am ghetting crazy by trying to get the reuslt i want to have…

I want to redefine some template stuff and i am not finding the clue :-/
It’s just a little problem, but without it, i have no fun to work any further :wink:
Also i get a baaad “undefined” at the palces i want to change the header… (this is why i would like to change it :wink: ).

1.
I just want to change some headers, for example the week_date:

scheduler.templates.week_date =function(date){ } OR scheduler.templates.week_date =function(start,end,ev){ } ?
My result should look like this: “01. - 08. March 2010” for the week…

2.
Also i want to change the event_bar_text in month view:

scheduler.templates.event_bar_text=function(start,end,ev){ return event.nachname+" "; }
In this case there should be a value of the event, for example the value nachname.
I don’t know how to call the method right, that it could access the value of event :-/

3.
Same problem in year- and agenda-view, but i am sure i could get it, if i first get an idea for the MONTH view :laughing:
Okay, i see, that there is a scheduler.templates.agenda_text for the text behind the agenda time, right? Perhaps, an additional question: I can change the start-date of agenda, but also the ending date?

Sorry if someone feels confused :frowning:
I am confused right now…

Best wishes,
2Fast

Hello,

My result should look like this: “01. - 08. March 2010” for the week…

week_date template gets 2 parameters. You can try to use the following

scheduler.templates.week_date = function(start,end){ var format = scheduler.date.date_to_str("%d"); return format(start)+". – "+ format(scheduler.date.add(end,-1,"day"))+". "+scheduler.templates.month_date(end); }

Also i want to change the event_bar_text in month view:

The existent template is

scheduler.templates.event_bar_text:function(start,end,event){ return event.text; }
Here event is event object. If you want to use nachname property, the template should be:

scheduler.templates.event_bar_text:function(start,end,event){ return event.nachname; }

that there is a scheduler.templates.agenda_text for the text behind the agenda time, right?

Yes, you’re right. The current template is

scheduler.templates.agenda_text = function(event){ return event.text; }

Perhaps, an additional question: I can change the start-date of agenda, but also the ending date?

You can define agenda_start and agenda_end

scheduler.config.agenda_start = new Date(...); scheduler.config.agenda_end = new Date(...);

Hey!

Thanks for your reply!
I needed about 1,5 hours to get my mistake… I tried and tried using the wrong paramenter of the function! I allways worked with (start,end,ev) instead of (start,end,event)… But allways tried using event.xyz …

Okay, i see, i am learning :wink:

The code for the correct date formating was also that helpful, that i would now be able to tell other users how to format things right :wink: Thanks for your time and knowledge!

Hello there!

Can i have the uncompressed Version of the dhtmlxscheduler_units.js ?
Unit view seems NOT working with template day_date declared like i did:

scheduler.templates.day_date = function(start,end){ var format = scheduler.date.date_to_str("%d"); return format(start)+". "+scheduler.templates.month_date(end); }

It is cause there’s no mont_date(end) at Unit-View…