Example #1
0
def format_date(date, tense = NEFNIFALL):
    """
    Usage:  {% date|format_date:"beyging" %}
    Before: tense is recognized by 'nf|þf|þgf|ef'
    After:
    """
    return _(u"%(weekday_name)s%(ending)s %(day)s. %(month)s %(year)s") % {
                    'weekday_name': get_day_of_week_in_icelandic(date.weekday(), tense),
                    'ending': ENDINGS[tense],
                    'day': date.day,
                    'month': MONTHS[date.month],
                    'year': date.year }
Example #2
0
 def test_ef(self):
     expected_values = [u"mánudags", u"þriðjudags", u"miðvikudags",
                         u"fimmtudags", u"föstudags", u"laugardags", u"sunnudags"]
     
     for i, expected_value in enumerate(expected_values):
         self.assertEqual(get_day_of_week_in_icelandic(i,EIGNARFALL), expected_value)