Ajey95 commited on
Commit
b945b4a
·
1 Parent(s): 3ebcca3

Fix: added helpers.py

Browse files
Files changed (1) hide show
  1. utils/helpers.py +19 -9
utils/helpers.py CHANGED
@@ -7,6 +7,7 @@ import json
7
  import os
8
  import random
9
  from datetime import datetime
 
10
 
11
  def load_quotes():
12
  """Load inspirational quotes from Gita/Vedas"""
@@ -36,18 +37,27 @@ def load_quotes():
36
  return default_quotes
37
 
38
  def get_greeting():
39
- """Get time-appropriate greeting"""
40
- hour = datetime.now().hour
41
-
42
- if 5 <= hour < 12:
43
- return "🌅 सुप्रभात (Good Morning)! Ready for some विद्या (learning)?"
44
- elif 12 <= hour < 17:
45
- return "☀️ नमस्कार (Good Afternoon)! Let's continue your studies!"
46
- elif 17 <= hour < 21:
47
- return "🌆 शुभ संध्या (Good Evening)! Time for some focused study?"
 
 
 
 
 
 
 
 
48
  else:
49
  return "🌙 शुभ रात्रि (Good Night)! Late night study session?"
50
 
 
51
  def format_indian_text(text, add_emojis=True):
52
  """Format text with Indian cultural elements"""
53
  if add_emojis:
 
7
  import os
8
  import random
9
  from datetime import datetime
10
+ from zoneinfo import ZoneInfo
11
 
12
  def load_quotes():
13
  """Load inspirational quotes from Gita/Vedas"""
 
37
  return default_quotes
38
 
39
  def get_greeting():
40
+ """
41
+ Returns a time-of-day appropriate greeting in English and Hindi,
42
+ specifically for the Indian Standard Time (IST) timezone.
43
+ """
44
+ # Define the Indian Standard Time timezone
45
+ ist_timezone = ZoneInfo("Asia/Kolkata")
46
+
47
+ # Get the current time in the IST timezone
48
+ current_time_ist = datetime.now(ist_timezone)
49
+ current_hour = current_time_ist.hour
50
+
51
+ if 5 <= current_hour < 12:
52
+ return "☀️ सुप्रभात (Good Morning)! Ready to start the day?"
53
+ elif 12 <= current_hour < 17:
54
+ return "☀️ नमस्कार (Good Afternoon)! Time for a study session?"
55
+ elif 17 <= current_hour < 21:
56
+ return "🌇 शुभ संध्या (Good Evening)! Wrapping up your studies?"
57
  else:
58
  return "🌙 शुभ रात्रि (Good Night)! Late night study session?"
59
 
60
+
61
  def format_indian_text(text, add_emojis=True):
62
  """Format text with Indian cultural elements"""
63
  if add_emojis: