anchor.diff:                       (htm
                          (:a :style "float: right;" :href (strcat url "?p=" (+ page 1)) "next page >")))))))))))
   
  +(defun populate-calendar (items &key (page 0) (count 20) paginate url (location t) (sidebar nil))
  +  (let ((event-list)
  +        )
  +    (dolist (item items)
  +      (let ((event (db (result-id item)))
  +            (last-occurance))
  +        (if (getf event :recurring)
  +          (dotimes (event 6) )
  +          (asetf event-list (sort (push (cons (result-time item) item) it)
  +                                  #'< :key #'car)))))
  +    (html
  +      (iter (for i from 0 to (- (+ start count) 1))
  +            (cond
  +              ((< i start)
  +               (setf items (cdr items)))
  +
  +              ((and (>= i start) items)
  +               (let* ((item (car items))
  +                      (item-time (result-time item)))
  +                 (multiple-value-bind (time date)
  +                     (humanize-exact-time item-time)
  +                   (unless (string= date calendar-date)
  +                     (setf calendar-date date)
  +                     (htm (:h3 :class "event-date" (str calendar-date))))
  +
  +                   (htm (str (event-activity-item item
  +                                                  :sidebar sidebar
  +                                                  :time time
  +                                                  :truncate t
  +                                                  :show-distance location)))))
  +               (setf items (cdr items)))
  +
  +              (t
  +               (when (and sidebar
  +                          (> (length items) count))
  +                 (htm (:a :href "/events" "see more events")))
  +
  +               (when (and (not sidebar)
  +                          (< (user-distance) 100)
  +                          (> (user-distance) 0))
  +                 (htm
  +                   (:div :class "item small"
  +                    (:em "Increasing the ")(:strong "show activity within")(:em " distance may yield more results."))))
  +               (finish)))
  +
  +            (finally
  +              (when (and paginate (or (> page 0) (cdr items)))
  +                (htm
  +                  (:div :class "item"
  +                   (when (> page 0)
  +                     (htm
  +                       (:a :href (strcat url "?p=" (- page 1)) "< previous page")))
  +                   "&nbsp;"
  +                   (when (cdr items)
  +                     (htm
  +                       (:a :style "float: right;" :href (strcat url "?p=" (+ page 1)) "next page >")))))))))))
  +
   (defun local-upcoming-events (&key (page 0) (count 20) (url "/events") (paginate t) (sidebar nil))
     (with-location
       (let* ((distance (user-distance))
  
positive.code:           (update-timestamp-until-day)
            (update-timestamp-until-week))))
  
      (setf new-time (timestamp-to-universal new-timestamp))
      (modify-db id :auto-updated-time new-time)
      (with-locked-hash-table (*db-results*)
        (setf (result-time result) new-time))
  
negative.code:                                        "days-of-week" days-of-week
                                         "by-day-or-date" by-day-or-date
                                         "weeks-of-month" weeks-of-month
                                         "end-date" (awhen local-end-time
                                                      (humanize-exact-time it))))))
  
                   ((post-parameter "submit-edits")
                    (submit-data))
  