Ignore:
Timestamp:
Dec 30, 2018, 7:37:55 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Store date of meet items including time. For items without specified time, just use current time (time of import).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Import/SalsaDance.php

    r11 r31  
    2222      $Item = GetTextBetween($Content, $ItemStart, $ItemEnd);
    2323      $MeetItem = new MeetItem();
    24       $MeetItem->Date = trim(GetTextBetween($Item, '<span class="created">', '</span>'));
    25       $MeetItem->Date = str_replace('. ', '.', $MeetItem->Date);
    26       if (strpos($MeetItem->Date, 'dnes v') !== false)
    27         $MeetItem->Date = str_replace('dnes v', HumanDate(time()), $MeetItem->Date);
    28       if (strpos($MeetItem->Date, 'včera v') !== false)
    29         $MeetItem->Date = str_replace('včera v', HumanDate(strtotime('-1 day', time())), $MeetItem->Date);
    30       $MeetItem->Date = HumanDateTimeToTime($MeetItem->Date);
     24      $MeetItem->Time = trim(GetTextBetween($Item, '<span class="created">', '</span>'));
     25      $MeetItem->Time = str_replace('. ', '.', $MeetItem->Time);
     26      if (strpos($MeetItem->Time, 'dnes v') !== false)
     27        $MeetItem->Time = str_replace('dnes v', HumanDate(time()), $MeetItem->Time);
     28      if (strpos($MeetItem->Time, 'včera v') !== false)
     29        $MeetItem->Time = str_replace('včera v', HumanDate(strtotime('-1 day', time())), $MeetItem->Time);
     30      $MeetItem->Time = HumanDateTimeToTime($MeetItem->Time);
    3131      $MeetItem->Name = trim(GetTextBetween($Item, '<div class="comment-name">', '</div>'));
    3232      $MeetItem->Message = trim(GetTextBetween($Item, '<p>', '</p>'));
Note: See TracChangeset for help on using the changeset viewer.