I have a number represented month and i want to replace it with month name, date filter not working:
{{ monthnumber|date:"M" }}
I want to place two links – next month and previous month, but i have only number of month.
How to do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ll need a custom template filter to convert the number into a month name. Pretty simple if you use the
calendarmodule from the standard library:Usage example:
{{ 5|month_name }}will output
May