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.
Această întrebare a fost marcată
1
Răspunde
4136
Vizualizări
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!
Îți place discuția? Nu doar citi, alătură-te!
Creează-ți un cont astăzi pentru a beneficia de funcții exclusive și a interacționa cu minunata noastră comunitate!
Înscrie-te| Postări similare | Răspunsuri | Vizualizări | Activitate | |
|---|---|---|---|---|
|
How to show field if selected
Rezolvat
|
|
1
mar. 21
|
6299 | |
|
|
1
oct. 25
|
652 | ||
|
Add month to date field
Rezolvat
|
|
2
iun. 26
|
19772 | |
|
|
0
iul. 20
|
4939 | ||
|
|
1
iul. 19
|
9546 |