feat: Implement flexible time display modes for activity status and a…#410
feat: Implement flexible time display modes for activity status and a…#410danbenba wants to merge 1 commit intonarcisbugeag:mainfrom
Conversation
…dd a development README.
nick22985
left a comment
There was a problem hiding this comment.
Hey,
Thank you for your pull request however their are a few issues with it.
I also cant get this working at all the timestamp just stays the same always. It none of the enum multi selects seem to change the logic.
| case "Fixed": | ||
| delete presence.startTimestamp; | ||
| delete presence.endTimestamp; | ||
| break; |
There was a problem hiding this comment.
this does the same thing as "hidden"
There was a problem hiding this comment.
this file should be deleted it serves no purpose
| @@ -185,7 +185,33 @@ | |||
| "vscord.status.showElapsedTime": { | |||
There was a problem hiding this comment.
this field is still used throughout the code base and is not deprecated. It is also used in your switch case block you made here: https://github.com/narcisbugeag/vscord/pull/410/changes#diff-25b8815d592fb665b70c36526091c1dfc73d09988d9199d21c228f825a1a1a75R109
| case "Elapsed": | ||
| if (config.get(CONFIG_KEYS.Status.ShowElapsedTime)) { | ||
| presence.startTimestamp = config.get(CONFIG_KEYS.Status.ResetElapsedTimePerFile) | ||
| ? Date.now() | ||
| : (previous.startTimestamp ?? Date.now()); | ||
| } else { | ||
| delete presence.startTimestamp; | ||
| } | ||
| break; | ||
| case "Current Interface": { | ||
| const now = new Date(); | ||
| const midnight = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0); | ||
| presence.startTimestamp = midnight.getTime(); | ||
| break; | ||
| } |
There was a problem hiding this comment.
this is also duplicated from the default statement. Should just be the same code path in the switch
This Pull Request adds more flexibility to the elapsed time display in Discord Rich Presence. It introduces new display modes and adds technical documentation to facilitate future contributions.
Main Changes
vscord.status.time.mode):Hidden: Completely hides the timestamp.Elapsed: Shows the time elapsed since the start of the activity (standard behavior).Current Interface: Shows the elapsed time since the beginning of the day (effectively displaying local time).Custom: Allows setting a specific timestamp to count from.Fixed: Shows a static timer (00:00).vscord.status.showElapsedTimeis now marked as deprecated in favor of the new, more comprehensive mode system.Technical Modifications
Why these changes?
Users have requested more control over how time is displayed. The "Current Interface" mode provides a more natural way to show the current time, while the "Custom" and "Fixed" modes offer advanced personalization for specific needs.