return jsonify({"value": value, "timestamp": timestamp})
-@app.route('/report/<int:year>/<int:month>')
+@app.route('/report/<int(fixed_digits=4):year>/<int(fixed_digits=2):month>')
def report(year, month):
- """Report for given year and month
+ """Report for given year (4 digits) and month (2 digits)
"""
paper_size = (29.7 / 2.54, 21. / 2.54) # A4
def index():
airvalue, airtime = currentairtemperature(cityid)
watervalue, watertime = currentwatertemperature(mainsensor)
+ this_month = first_of_month(datetime.date.today(), 0)
+ last_month = first_of_month(this_month, -1)
return render_template(
'seepark_web.html',
watertime=watertime,
airvalue=airvalue,
airtime=airtime,
+ this_month=this_month,
+ last_month=last_month
)