webcalendar

Check-in [b3bc3cc813]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fiddle with import of calendar events and when they should be treated as untimed rather than timed with 24 hour duration
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:b3bc3cc8139ec8fc41985d2ee5f0d49357ef9c545324ea662377949442feba48
User & Date: ajv-899-334-8894@vsta.org 2017-08-05 16:10:26
Context
2018-01-11
23:51
Update path. Fix false positive when we should filter by days of week. Include account name in Python event dict, sometimes useful in displaying events. check-in: 774850c495 user: ajv-899-334-8894@vsta.org tags: master, trunk
2017-08-05
16:10
Fiddle with import of calendar events and when they should be treated as untimed rather than timed with 24 hour duration check-in: b3bc3cc813 user: ajv-899-334-8894@vsta.org tags: master, trunk
16:09
For day count, be sure to allow for that event's time in the current day. Treat zero duration events with a time as timed. check-in: 281fe22e49 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to includes/xcal.php.

2463
2464
2465
2466
2467
2468
2469
2470



2471




2472
2473
2474
2475
2476
2477
2478
    if ( $fevent['StartTime'] == $fevent['EndTime'] ) {
      $fevent['Untimed'] = 1;
      $fevent['Duration'] = 0;
    } else {
      $fevent['Duration'] = ( $fevent['EndTime'] - $fevent['StartTime'] ) / 60;
    }
  } else if ( isset ( $event['duration'] ) ) {
    $fevent['EndTime'] = $fevent['StartTime'] + $event['duration'] * 60;



    $fevent['Duration'] = $event['duration'];




  } else if ( isset ( $event['dtstartDATETIME'] ) ) {
    // Untimed
    $fevent['EndTime'] = $fevent['StartTime'];
    $fevent['Untimed'] = 1;
    $fevent['Duration'] = 0;
  }








|
>
>
>
|
>
>
>
>







2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
    if ( $fevent['StartTime'] == $fevent['EndTime'] ) {
      $fevent['Untimed'] = 1;
      $fevent['Duration'] = 0;
    } else {
      $fevent['Duration'] = ( $fevent['EndTime'] - $fevent['StartTime'] ) / 60;
    }
  } else if ( isset ( $event['duration'] ) ) {
    $dur = $event['duration'];
    // All day(s)
    if (($dur % 1440) == 0) {
	$fevent['Untimed'] = 1;
	$fevent['Duration'] = 0;
    } else {
	$fevent['Duration'] = $dur;
    }
    $fevent['EndTime'] = $fevent['StartTime'] + ($dur * 60);
  } else if ( isset ( $event['dtstartDATETIME'] ) ) {
    // Untimed
    $fevent['EndTime'] = $fevent['StartTime'];
    $fevent['Untimed'] = 1;
    $fevent['Duration'] = 0;
  }