Skip to content

Add option to reverse the day/month sidebar orientation #227

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

M-Davies
Copy link

Closes: #224

Signed-off-by: Morgan Davies <25231953+M-Davies@users.noreply.github.com>
@uphy
Copy link
Owner

uphy commented Mar 29, 2025

Thank you!

It seems that we have to pass the setting field:

diff --git a/src/plugin/ui/index.ts b/src/plugin/ui/index.ts
index f7ed24e..2ce052c 100644
--- a/src/plugin/ui/index.ts
+++ b/src/plugin/ui/index.ts
@@ -29,6 +29,7 @@ export class ReminderPluginUI {
       this.plugin.app.workspace,
       this.plugin.reminders,
       this.plugin.settings.reminderTime,
+      this.plugin.settings.reverseSidebarGroupFormat,
       // On select a reminder in the list
       (reminder) => {
         if (reminder.muteNotification) {

Also, please run the npm run lint:fix

@uphy
Copy link
Owner

uphy commented Mar 29, 2025

By the way, I'm struggling with how to handle these date formats.

It seems the obsidian-reminder-plugin has the following date displays:

  • Date (the setting already exists)
  • Date + time (the setting already exists)
  • Year + month
  • Month + day
  • Month + day + day of the week

It feels like a bit too much to introduce individual settings for each of these.

On the other hand, I'm not sure if a single setting like reverseSidebarGroupFormat, which you introduced in this pull request (i.e., true or false), can satisfy the needs of various users.

@uphy
Copy link
Owner

uphy commented Mar 30, 2025

I'm trying to implement the feature with 3 additional settings.

export type DateDisplayFormat = {
yearMonthFormat: string;
monthDayFormat: string;
shortDateWithWeekdayFormat: string;
};
export type DateDisplayFormatPreset = {
name: string;
format: DateDisplayFormat;
};
export const dateDisplayFormatPresets: DateDisplayFormatPreset[] = [
{
name: "US Style",
format: {
yearMonthFormat: "MMMM YYYY",
monthDayFormat: "MM/DD",
shortDateWithWeekdayFormat: "M/DD (ddd)",
},
},
{
name: "EU Style",
format: {
yearMonthFormat: "MMMM YYYY",
monthDayFormat: "DD/MM",
shortDateWithWeekdayFormat: "D/MM (ddd)",
},
},
{
name: "JP Style",
format: {
yearMonthFormat: "YYYY年MM月",
monthDayFormat: "MM/DD",
shortDateWithWeekdayFormat: "M月D日 (ddd)",
},
},
];

@Noracsa2000
Copy link

Closes: #224

Thank you for your contribution. However it does not close #224, but #223.

#224 is not about reversing day/month, but about being able to set the date in any way and length.

@Noracsa2000
Copy link

By the way, I'm struggling with how to handle these date formats.
It seems the obsidian-reminder-plugin has the following date displays:
* Date (the setting already exists)
* Date + time (the setting already exists)
* Year + month
* Month + day
* Month + day + day of the week

I understand that having individual settings for each of these might be too much.

However, the way the latter three are currently displayed seems arbitrary and deviates from Obsidian standards.

How about using the existing "Date" setting, which includes day, month and year, and just truncating it for the other settings:

  • Year + month = Date - day
  • Month + day = Date - year

(Day of the week could be optional for the sidebar header via a checkbox)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Date format in sidebar pane
3 participants