Skip to content

Commit ce0e3ad

Browse files
authored
Update update_commit.py
1 parent 4082155 commit ce0e3ad

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/update_commit.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
# Get the current date
1717
today = datetime.today()
1818
day_of_month = today.strftime("%d") # Get current day of the month
19-
month = today.strftime("%b") # Get current month (e.g., Nov)
19+
month = today.strftime("%B") # Get current full month name (e.g., November)
2020

21-
# Format the solution file name for today (e.g., 07(Nov)Next Problem.md)
22-
today_solution_filename = f"{day_of_month}({month}){today.strftime('%A')}.md"
21+
# Format the solution file name for today (e.g., 06(Nov)Root to leaf paths sum.md)
22+
today_solution_filename = f"{day_of_month}({today.strftime('%b')}){today.strftime('%A')}.md"
2323

2424
# Prepare the badge URL and commit link to update README
2525
badge_url = "https://img.shields.io/badge/GeeksforGeeks-Solution%20of%20the%20Day-blue"
@@ -29,15 +29,15 @@
2929
with open(readme_path, "r") as readme:
3030
content = readme.read()
3131

32-
# Update today's solution link
32+
# Update today's solution link in the README
3333
content = re.sub(
3434
r"(?<=<!--START_SECTION:latest-commit-->).*?(?=<!--END_SECTION:latest-commit-->)",
3535
f"\nhttps://github.com/{repository}/blob/main/{month}%202024%20GFG%20SOLUTION/{today_solution_filename}\n",
3636
content,
3737
flags=re.DOTALL
3838
)
3939

40-
# Update badge link
40+
# Update the badge link
4141
content = re.sub(
4242
r"(?<=<!--START_SECTION:potd-badge-->).*?(?=<!--END_SECTION:potd-badge-->)",
4343
f"\n{badge_link}\n",

0 commit comments

Comments
 (0)