1- import reflex as rx
2- import pytz
31from datetime import datetime , timedelta
42
3+ import pytz
4+ import reflex as rx
5+
56# Común
67
78
@@ -15,9 +16,11 @@ def lang() -> rx.Component:
1516 {"name" : "og:type" , "content" : "website" },
1617 {"name" : "og:image" , "content" : preview },
1718 {"name" : "twitter:card" , "content" : "summary_large_image" },
18- {"name" : "twitter:site" , "content" : "@mouredev" }
19+ {"name" : "twitter:site" , "content" : "@mouredev" },
1920]
2021
22+ BEEHIIV_SCRIPT = "https://subscribe-forms.beehiiv.com/embed.js"
23+
2124# Index
2225
2326index_title = "MoureDev | Te enseño programación y desarrollo de software"
@@ -51,7 +54,7 @@ def lang() -> rx.Component:
5154 3 : "Jueves" ,
5255 4 : "Viernes" ,
5356 5 : "Sábado" ,
54- 6 : "Domingo"
57+ 6 : "Domingo" ,
5558}
5659
5760MONTHS = {
@@ -66,7 +69,7 @@ def lang() -> rx.Component:
6669 9 : "Septiembre" ,
6770 10 : "Octubre" ,
6871 11 : "Noviembre" ,
69- 12 : "Diciembre"
72+ 12 : "Diciembre" ,
7073}
7174
7275
@@ -86,24 +89,30 @@ def next_date(dates: dict, timezone: str) -> str:
8689 if current_weekday not in dates or dates [current_weekday ] == "" :
8790 continue
8891
89- time_utc = datetime .strptime (dates [current_weekday ], "%H:%M" ).replace (
90- tzinfo = pytz .UTC ).timetz ()
92+ time_utc = (
93+ datetime .strptime (dates [current_weekday ], "%H:%M" ).replace (tzinfo = pytz .UTC ).timetz ()
94+ )
9195
92- next_time = datetime .combine (
93- now .date (), time_utc ).astimezone (tz ).timetz ()
96+ next_time = datetime .combine (now .date (), time_utc ).astimezone (tz ).timetz ()
9497
9598 if current_time < next_time or weekday > 0 :
9699
97100 next_date = now + timedelta (days = weekday )
98101
99102 local_date = datetime (
100- next_date .year , next_date .month , next_date .day ,
101- time_utc .hour , time_utc .minute , tzinfo = pytz .UTC ).astimezone (tz )
103+ next_date .year ,
104+ next_date .month ,
105+ next_date .day ,
106+ time_utc .hour ,
107+ time_utc .minute ,
108+ tzinfo = pytz .UTC ,
109+ ).astimezone (tz )
102110
103111 day = "Hoy" if weekday == 0 else WEEKDAYS [local_date .weekday ()]
104- zones = timezone .replace ('_' , ' ' ).split ('/' )
112+ zones = timezone .replace ("_" , " " ).split ("/" )
105113
106114 return local_date .strftime (
107- f"{ day } , %d de { MONTHS [local_date .month ]} a las %H:%M | Zona horaria: { zones [len (zones ) - 1 ]} " )
115+ f"{ day } , %d de { MONTHS [local_date .month ]} a las %H:%M | Zona horaria: { zones [len (zones ) - 1 ]} "
116+ )
108117
109118 return ""
0 commit comments