Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update remember-the-date extension #15039

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions extensions/remember-the-date/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Remember the Date Changelog

## [Up Next Unit of Time Synced with Setting] – 2024-10-22

– Uses 'days' as the unit of time for the Up Next date, if selected in settings (just like list)

## [Add Countdown Option] - 2024-10-14

- Added a countdown option in the preferences to display the countdown in days
Expand Down
3 changes: 2 additions & 1 deletion extensions/remember-the-date/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"author": "pernielsentikaer",
"contributors": [
"samuelkraft",
"ridemountainpig"
"ridemountainpig",
"aryan_thatte"
],
"license": "MIT",
"keywords": [
Expand Down
9 changes: 6 additions & 3 deletions extensions/remember-the-date/src/menu-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ export default function Command() {
return null;
}

const untilNextDate = `${nextDate.name.length > 15 ? nextDate.name.substring(0, 15) + "..." : nextDate.name} ${moment(
nextDate.date,
).fromNow()}`;
const difference = showCountdownByDay
? "in " + moment(nextDate.date).diff(new Date(), "days") + " days"
: moment(nextDate.date).fromNow();
const untilNextDate = `${
nextDate.name.length > 15 ? nextDate.name.substring(0, 15) + "..." : nextDate.name
} ${difference}`;

return (
<MenuBarExtra icon={nextDate.icon} title={untilNextDate}>
Expand Down
Loading