User: hurairaidrees@gmail.com clicked save for playground/nutech/receipt/receipt.bpmn

This commit is contained in:
sartography-automated-committer 2024-03-04 06:20:27 +00:00
parent 7798b60216
commit 2fc86566e8
1 changed files with 8 additions and 19 deletions

View File

@ -127,36 +127,25 @@ minutes = 0
seconds = 0
days = 0
# Extract the numeric part of the time value
numeric_part = ""
for char in timer_value_1:
if char.isdigit():
numeric_part += char
else:
break
# Add 'PT' to the numeric value
numeric_part_with_PT = 'PT' + numeric_part
# Populate values based on the selected time format
if time_format == "Hour(s)":
hours = int(numeric_part) if numeric_part.isdigit() else 0
hours = timer_value_1
elif time_format == "Minute(s)":
minutes = int(numeric_part) if numeric_part.isdigit() else 0
minutes = timer_value_1
elif time_format == "Second(s)":
seconds = int(numeric_part) if numeric_part.isdigit() else 0
seconds = timer_value_1
elif time_format == "Day(s)":
days = int(numeric_part) if numeric_part.isdigit() else 0
days = timer_value_1
# Create ISO 8601 string representation based on the selected time format
if time_format == "Hour(s)":
timer_value_1 = f"{str(numeric_part_with_PT)}H"
timer_value_1 = f"PT{hours}H"
elif time_format == "Minute(s)":
timer_value_1 = f"{str(numeric_part_with_PT)}M"
timer_value_1 = f"PT{minutes}M"
elif time_format == "Second(s)":
timer_value_1 = f"{str(numeric_part_with_PT)}S"
timer_value_1 = f"PT{seconds}S"
elif time_format == "Day(s)":
timer_value_1 = f"{str(numeric_part_with_PT)}D"
timer_value_1 = f"P{days}D"
# Now timer_value_tfc_str contains the ISO 8601 string representation based on the selected time format
print(timer_value_1)