saschagottfried / todopyramid

My refactored version of ToDo Pyramid
1 stars 0 forks source link

remove timezone conversion from TodoGrid rendering #7

Closed saschagottfried closed 10 years ago

saschagottfried commented 10 years ago

grid.TodoGrid.due_date_td

    def due_date_td(self, col_num, i, item):
        """Generate the column for the due date.
        """
        if item.due_date is None:
            return HTML.td('')
        span_class = 'due-date badge'
        if item.past_due:
            span_class += ' badge-important'
        due_date = localize_datetime(item._due_date, self.user_tz)
        span = HTML.tag(
            "span",
            c=HTML.literal(due_date.strftime('%Y-%m-%d %H:%M:%S')),
            class_=span_class,
        )
        return HTML.td(span)
saschagottfried commented 10 years ago

Now we do timezone handling in model