I have a json file with the below format [seconds * min * hour * day of month * month * day of week]
{
"cronExpression": "0 48 10 ? * TUE-SAT"
}
and I want to read the above json and convert it to the below,
"When": {
"WeekDays": ["TUE","WED","THU","FRI","SAT"],
"MonthDays": ["NONE"],
"FromTime": "1048"
}
I am new to Python, and is there any lib to take the string TUE-SAT
and convert it to ["TUE","WED","THU","FRI","SAT"]
I am thinking of taking the string and use switch case to add manually append the string, but this could leads to complex logic with different propositions.
The TUE-SAT – could be dynamic such as MON-WED or FRI-SAT
any help appreciated. thanks!
1