162
rated 0 times
[
167]
[
5]
/ answers: 1 / hits: 20501
/ 14 Years ago, tue, february 22, 2011, 12:00:00
What would be the easy way of achieving such below? selected_date comes from django context as a python date :
<script type=text/javascript>
var selected_year = {{ selected_date|date:Y }}
var selected_month = {{ selected_date|date:m }} - 1;
var selected_day = {{ selected_date|date:d}}
var selected_date = new Date(selected_year, selected_month, selected_day);
alert(selected_date);
</script>
More From » django