code/superant.com.schedule/saveicseventrecord.rb in rwdschedule-0.95 vs code/superant.com.schedule/saveicseventrecord.rb in rwdschedule-0.96

- old
+ new

@@ -26,20 +26,32 @@ if ! @a_eventicsday.empty? temptimedata = temptimedata + @a_eventicsday.to_s else temptimedata = temptimedata + "00" end + daydate = temptimedata if ! @a_eventicshour.empty? temptimedata= temptimedata + "T" + @a_eventicshour.to_s else temptimedata = temptimedata + "T" + "00" end if ! @a_eventicsminute.empty? temptimedata = temptimedata + @a_eventicsminute.to_s else temptimedata = temptimedata + "00" end + if ! @a_eventendicshour.empty? + tempendtimedata= daydate + "T" + @a_eventendicshour.to_s + else + tempendtimedata = daydate + "T" + "00" + end + if ! @a_eventendicsminute.empty? + tempendtimedata = tempendtimedata + @a_eventendicsminute.to_s +else + tempendtimedata = tempendtimedata + "00" + end + if ! @a_eventicssummary.empty? summarydataText = @a_eventicssummary.to_s else summarydataText = "" end @@ -54,15 +66,16 @@ locationdataText = "" end starttime = temptimedata + "00" + endtime = tempendtimedata + "00" # Create a new event and add it to the calendar event.dtstart = starttime - event.dtend = starttime + event.dtend = endtime event.summary = summarydataText event.description = descriptiondataText event.location = locationdataText cal.add(event) # Now generate the string and then parse it so we can verify @@ -70,16 +83,16 @@ calString = cal.to_s p calString #cals = Icalendar::CalendarParser.new(calString).parse # cal2 = cals.first - # begin # exception trapped block + begin # exception trapped block fileName = File.join( $rwdschedule_directory, fullnewname ) fd = File.open(fileName,"w") fd.print( calString ) # save the record info to the file fd.close - @neweventresult= calString # show the record info in the browser - # rescue SystemCallError, StandardError - # $stderr.print "system call error: " + $! - # end # exception rescue + @newicseventresult= calString # show the record info in the browser + rescue SystemCallError, StandardError + $stderr.print "system call error: " + $! + end # exception rescue end end