[Laszlo-checkins] r10052 - openlaszlo/trunk/demos/calendar

jcrowley@openlaszlo.org jcrowley at openlaszlo.org
Thu Jun 26 22:01:39 PDT 2008


Author: jcrowley
Date: 2008-06-26 22:01:27 -0700 (Thu, 26 Jun 2008)
New Revision: 10052

Modified:
   openlaszlo/trunk/demos/calendar/cal-data.lzx
   openlaszlo/trunk/demos/calendar/event.lzx
Log:
Change 20080626-laszlo-8 by laszlo at T43-L3XEXMW on 2008-06-26 14:16:10 EDT
    in /home/laszlo/src/svn/openlaszlo/trunk-liquid
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: UPDATE: Time in calendar can be changed to end before it starts

New Features:

Bugs Fixed: LPP-6315 - Time in calendar can be changed to end before it starts

Technical Reviewer: max
QA Reviewer: promanik
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: Since events aren't really designed, currently, to be
    spread across multiple days, I limited events so that they
    can't run over into the next day.  Having multi-day events
    would require too dramatic an overhaul to the entire app.
    
    Also, there was a weird issue with the time being a half an
    hour off, which was the result of the background grid being
    pushed down a bit so that "12AM" wasn't clipped at the top.
    I could've either adjusted the grid so that it WAS clipped,
    or changed the events to compensate, so I did the latter.

Tests: Open Calendar in SWF or DHTML.  Create a new event, or
    edit an existing event.  Click the time arrow.  The event
    end time should stop before spilling over into the next day.
    If you drag the event to a later time, the end time should
    auto-adjust so that it doesn't spill over into the next day
    as well.  (You can't create an eight-hour event at noon and
    then drag it to 9 PM and have it run into the next day at
    eight hours in length.)
    
    Also, when the day is expanded, the events should now be at
    the right time on the time grid, instead of half an hour off.



Modified: openlaszlo/trunk/demos/calendar/cal-data.lzx
===================================================================
--- openlaszlo/trunk/demos/calendar/cal-data.lzx	2008-06-27 04:31:13 UTC (rev 10051)
+++ openlaszlo/trunk/demos/calendar/cal-data.lzx	2008-06-27 05:01:27 UTC (rev 10052)
@@ -264,6 +264,18 @@
 
             if (ehour < 0) ehour += 24;
             ehour = ehour % 24;
+            var mincheck = 0;
+            var smincheck = 0;
+            if(evlenmin != 0){
+                mincheck = ((60 / evlenmin) * .25);
+                if(smin != 0){
+                    smincheck = ((60 / smin) * .25);
+                }
+            }
+            if (shour < 24 && shour + evlenhour + mincheck + smincheck >= 24){
+                ehour = 23;
+                emin = 45;
+            }
             tempDP.setNodeAttribute('hour', ehour);
             tempDP.setNodeAttribute('minute', emin);
         ]]></method>
@@ -417,10 +429,12 @@
                     }
                     if (eHour < 0) eHour += 24;
                     eHour = eHour % 24;
-                    tempDP.setFromPointer( currenteventDP );
-                    tempDP.setXPath('end[1]');
-                    tempDP.setNodeAttribute( 'hour' , eHour );
-                    tempDP.setNodeAttribute( 'minute' , eMinute );
+                    if(eHour != 0){
+                        tempDP.setFromPointer( currenteventDP );
+                        tempDP.setXPath('end[1]');
+                        tempDP.setNodeAttribute( 'hour' , eHour );
+                        tempDP.setNodeAttribute( 'minute' , eMinute );
+                    }
                 }
             }
             ]]>

Modified: openlaszlo/trunk/demos/calendar/event.lzx
===================================================================
--- openlaszlo/trunk/demos/calendar/event.lzx	2008-06-27 04:31:13 UTC (rev 10051)
+++ openlaszlo/trunk/demos/calendar/event.lzx	2008-06-27 05:01:27 UTC (rev 10052)
@@ -121,7 +121,7 @@
             <attribute name="x"
                        value="24"/>
             <attribute name="y"
-                       value="${this.startTime * this.pixelPerMin}"/>
+                       value="${this.startTime * this.pixelPerMin + (pixelPerMin * 30)}"/>
             <attribute name="height"
                        value="${Math.max( 22, ( this.endTime - this.startTime )
                                               * this.pixelPerMin )}" />



More information about the Laszlo-checkins mailing list