Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,8 +31,13 @@ Eine kreative {channel}-Kampagne für {product}, z. B. mit exklusiven Angebote
|
|
| 31 |
"""
|
| 32 |
|
| 33 |
def add_campaign(name, goal, product, channel, start, end, budget, responsible):
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
campaigns.append({
|
| 37 |
"Name": name,
|
| 38 |
"Ziel": goal,
|
|
|
|
| 31 |
"""
|
| 32 |
|
| 33 |
def add_campaign(name, goal, product, channel, start, end, budget, responsible):
|
| 34 |
+
try:
|
| 35 |
+
if isinstance(start, str):
|
| 36 |
+
start = datetime.datetime.strptime(start, "%Y-%m-%d")
|
| 37 |
+
if isinstance(end, str):
|
| 38 |
+
end = datetime.datetime.strptime(end, "%Y-%m-%d")
|
| 39 |
+
except Exception as e:
|
| 40 |
+
return pd.DataFrame(campaigns), f"❌ Ungültiges Datum: {e}"
|
| 41 |
campaigns.append({
|
| 42 |
"Name": name,
|
| 43 |
"Ziel": goal,
|