diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cb46bc..9411471 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Version number is based on [Semver](https://semver.org/). Note that major version zero (0.y.z) is for initial development and anything may change at any time. +## [0.8.1] 2024-11-28 + +## Fixed + +- Windows-specific error with format string for timestamps + ## [0.8.0] 2024-11-19 ## Added diff --git a/canvascli/main.py b/canvascli/main.py index d02bd74..bf793a8 100644 --- a/canvascli/main.py +++ b/canvascli/main.py @@ -4,6 +4,7 @@ import getpass import json import os +import platform import re from collections import defaultdict from datetime import datetime @@ -770,7 +771,8 @@ def save_prepared_grades_to_file(self): writer.sheets['Sheet1'].write(0, 0, "Record Name:") writer.sheets['Sheet1'].write(0, 1, "Course Registrations") writer.sheets['Sheet1'].write(1, 0, "Exported On:") - writer.sheets['Sheet1'].write(1, 1, pd.Timestamp.now().strftime('%b %-d, %Y %-I:%-M %p')) + time_format = '%b %#d, %Y %#I:%#M %p' if platform.system() == 'Windows' else '%b %-d, %Y %-I:%-M %p' + writer.sheets['Sheet1'].write(1, 1, pd.Timestamp.now().strftime(time_format)) click.secho(f'Grades saved to {excel_file_name}.', bold=True, fg='green') return