0

Calender Provide a way do define a default duration for a new Event [closed]

asked 2015-02-26 14:25:33 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

updated 2015-03-03 09:27:07 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

Provide a way do define a default duration for a new Event

I saw new feature added as per this link

Can i know how to set different default duration ?

But the issue track, says it is still open.

So whether it is available or not ?

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by Senthilchettyin
close date 2015-03-03 09:25:42

3 Answers

Sort by ยป oldest newest most voted
1

answered 2015-03-03 09:03:59 +0800

vincentjian gravatar image vincentjian
2245 6

updated 2015-03-03 09:04:26 +0800

Try this

<zk xmlns:w="client">
    <calendar timeslots="2">
        <attribute w:name="getNewEventTimeSlots_">
            function() {
                return 1;
            }
        </attribute>
    </calendar>
</zk>
link publish delete flag offensive edit
0

answered 2015-03-03 01:52:25 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2015-03-03 01:58:54 +0800

it is closed, and also updated in jira.

you cannot set it directly, the feature was about adding a function you can override to determine the default duration.

the source code is also available and the change related to ZKCAL-51 is available, here the added function you can override on the client side, to return a different number of timeslots for a new event: https://github.com/zkoss/zkcalendar/commit/94ff4ae4d26785de6b83d88c3214554f68bcba11#diff-a5853c2eec6e01ee33b0ccf9e63f32c6R1025

link publish delete flag offensive edit

Comments

So you mean to say that, i need download the source code, change according to my value, compile ad use the local jar file ?

Senthilchettyin ( 2015-03-03 02:13:21 +0800 )edit

no... in the source code you can see which function you can override. and then use the existing functionalities for client side overriding (http://books.zkoss.org/wiki/ZKClient-sideReference/GeneralControl/WidgetCustomization#OverrideaWidget_Method)

cor3000 ( 2015-03-03 02:32:10 +0800 )edit

Ok that is new to me. I will try my best :). Meanwhile when you are free, please post an example

Senthilchettyin ( 2015-03-03 02:38:57 +0800 )edit
0

answered 2015-03-03 09:25:23 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

Yes it works as desired. Thank you. Here is my Code

                        <calendars id="calendars"
                            firstDayOfWeek="Sunday" height="100%" timeslots="4"
                            onEventCreate="@command('onSelectAppt',v=event)"
                            onEventEdit="@command('onSelectAppt',v=event)">
                            <attribute
                                w:name="getNewEventTimeSlots_">
                                function() { return 1; }
                            </attribute>
                        </calendars>

But one small suggestion for the future release. The value be same as the timeslots value.

So if that user wants 4 time slots in one hour , then it should be 15 min by default.

And also, please look my other problem in setting the title of the event

http://forum.zkoss.org/question/96606/problem-in-setting-custom-title-for-calender-event-with-own-dateformatter/

link publish delete flag offensive edit

Comments

You can always drag desired timeslot to create a new event.

vincentjian ( 2015-03-03 09:43:47 +0800 )edit

That is another issue. When i try to extend the time by draging for already created event, it shows "Only Allowed to Move within timeslot" . what does this mean ?

Senthilchettyin ( 2015-03-03 09:56:07 +0800 )edit

By Another request is, can we disable drag and moving event by the user ?

Senthilchettyin ( 2015-03-03 09:56:28 +0800 )edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-02-26 14:25:33 +0800

Seen: 20 times

Last updated: Mar 03 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More