<commit_before>#!/usr/local/bin/python
# -*- coding: utf-8 -*-
from django.template import Library 
from django.conf import settings
from datetime import date, timedelta
import locale

register = Library()

@register.filter
def display_date(event_date):
    
    loc = settings.__getattr__('LANGUAGE_CODE')

    if not event_date:
        return '';
    elif (__is_today(event_date)):
        return "Heute, " + event_date.strftime("%H:%M")
    elif (__is_tomorrow(event_date)):
        return "Morgen, " + event_date.strftime("%H:%M")
    elif (__is_the_day_after_tomorrow(event_date)):
        return "Übermorgen, " + event_date.strftime("%H:%M")
    else:
        return event_date.strftime("%A, %d. %b %H:%M")
    

def __is_today(event_date):
    return event_date.date() == date.today()
    
def __is_tomorrow(event_date):
    return event_date.date() == date.today() + timedelta(days=1)
    
def __is_the_day_after_tomorrow(event_date):
    return event_date.date() == date.today() + timedelta(days=2)<commit_msg>localized date on index site<commit_after>#!/usr/local/bin/python
# -*- coding: utf-8 -*-
from django.template import Library 
from django.conf import settings
from datetime import date, timedelta
import locale
from django.utils.translation import ugettext

register = Library()

@register.filter
def display_date(event_date):
    
    loc = settings.__getattr__('LANGUAGE_CODE')

    if not event_date:
        return '';
    elif (__is_today(event_date)):
        return "Heute, " + event_date.strftime("%H:%M")
    elif (__is_tomorrow(event_date)):
        return "Morgen, " + event_date.strftime("%H:%M")
    elif (__is_the_day_after_tomorrow(event_date)):
        
        return "Übermorgen, " + event_date.strftime("%H:%M")
    else:
        weekday = ugettext (event_date.strftime("%A"))
        day = event_date.day
        month = ugettext (event_date.strftime("%B"))[:3]
        time = event_date.strftime("%H:%M")
        return weekday + ", " + str(day) + ". " + month + " " + time
         
    

def __is_today(event_date):
    return event_date.date() == date.today()
    
def __is_tomorrow(event_date):
    return event_date.date() == date.today() + timedelta(days=1)
    
def __is_the_day_after_tomorrow(event_date):
    return event_date.date() == date.today() + timedelta(days=2)
{'fraction_non_alphanumeric': 0.1410090556274256, 'fraction_numerical': 0.00301854247520483, 'mean_word_length': 3.575936883629191, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1543466', 'n_tokens_mistral': 802, 'n_tokens_neox': 768, 'n_words': 151}