month_ids is a list of months like this... [('Apr07', 'April 2007'), ('Mar07', 'March 2007'), ('Feb07', 'February 2007')]
which can be used in a select box like this..
month = forms.ChoiceField(choices=(months))
1 2 3 4 5 6 7 8 9 10 11 | from mx.DateTime import *
from datetime import datetime
date = now()
month_ids = []
while not (date.month == 4 and date.year == 2004):
month_ids.append((date.strftime('%b%y'),date.strftime('%B %Y')))
date = date + RelativeDateTime(months=-1)
print month_ids
#date.days_in_month
|
More like this
- Browser-native date input field by kytta 1 month, 1 week ago
- Generate and render HTML Table by LLyaudet 1 month, 2 weeks ago
- My firs Snippets by GutemaG 1 month, 2 weeks ago
- FileField having auto upload_to path by junaidmgithub 2 months, 3 weeks ago
- LazyPrimaryKeyRelatedField by LLyaudet 3 months ago
Comments
Please login first before commenting.