Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5041 มุมมอง

Hello, I need to print the date of the order, but with an added year.

Example: If ${object.date_order} is 2014-03-06, I need to print: "Hi, this order corresponds to the period 2014-03-06 to 2015-03-06".

I managed to extract the year using ${object.date_order[:4]}, but is a string variable. So I can not perform mathematical operations. I do not know how to program in python, but reading I saw that there are functions like "float" or "int" that transform a string into a number. The problem is I can not implement these functions in the template. Every time I try to apply those functions I get an empty body.

Could anyone give me a hand with this?

Thanks !

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ม.ค. 24
4386
Problem with email template (SOLVED) แก้ไขแล้ว
2
ม.ค. 24
10096
1
มี.ค. 21
9596
0
ม.ค. 19
7168
1
มี.ค. 15
6962