Spaces:
Sleeping
Sleeping
File size: 448 Bytes
0feef8c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | from datetime import datetime
from utils.storage import load_json, save_json
REFLECTION_FILE = "data/reflections.json"
def add_reflection(reflection_text):
reflections = load_json(REFLECTION_FILE)
reflections.append({
"date": datetime.now().strftime("%Y-%m-%d"),
"reflection": reflection_text
})
save_json(REFLECTION_FILE, reflections)
return True
def get_reflections():
return load_json(REFLECTION_FILE)
|