I'm stuck.I have field.date contract_start ,field.selection contract_duration and field.char contract_expired.What i want is when a person chooses a date they want their contract to start and for how long they want their contract to last, contract_expired get the date for when the contract ends.
คำถามนี้ถูกตั้งค่าสถานะ
1
ตอบกลับ
4118
มุมมอง
Hi Zlatt,
You can calculate the expiration date by adding the duration to the start date. In Python, you can use the datetime module for this:
pythonCopy codefrom datetime import timedelta contract_start = # Your contract start date contract_duration = # Your selected duration, e.g. 3 (for 3 months) contract_expired = contract_start + timedelta(days=30 * contract_duration)
This will give you the date when the contract will expire.
Regards,
Team Ksolves!
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ| Related Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
How to show field if selected
แก้ไขแล้ว
|
|
1
มี.ค. 21
|
6269 | |
|
|
1
ต.ค. 25
|
652 | ||
|
Add month to date field
แก้ไขแล้ว
|
|
2
มิ.ย. 26
|
19741 | |
|
|
0
ก.ค. 20
|
4910 | ||
|
|
1
ก.ค. 19
|
9493 |