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

[Feature Request] Customize how a Datetime will appear in a note/comment #1037

Open
guiu57023 opened this issue Dec 6, 2023 · 1 comment

Comments

@guiu57023
Copy link

Hello,
Firstly thanks you guys for creating and maintaining such cool project.

I would like to customize how a Datetime appears in a note/comment using as an alternative to
dangerouslySetNoteTransformFunction approach.

Assuming WebViewer-UI uses Dayjs to handle Datetime formats and Dayjs allows to work with custom plugins (Nodejs and Browser).

If somehow WebViewer-UI allows to load a Dayjs plugin it would provide the expected result.

With guidance I could provide a patch (if needed) or if it's a skill issue, please point it, so I can fill the gap.
Allowing to load Dayjs plugin would benefit the community/project and would be better than maintain an own version of the project.

I asked same question at Discord link.

// https://docs.apryse.com/api/web/UI.html#.setTimezone__anchor
webviewer.UI.setTimezone('Europe/London');
// https://docs.apryse.com/api/web/7.3/WebViewerInstance.html#setNoteDateFormat__anchor
webviewer.UI.setNoteDateFormat('DD.MM.YYYY HH:MM:ss Z');
The issue is we need to apply an custom format that dayjs doesn't handle.
The idea would be creating dayjs plugin and load with webviewer.

If its possible having a webviewer.UI.setCustomNoteDateFormat resulting e.g. "05-Dec-2023 00:30:17 (UTC+13:00, SST)"

Another option (actually is the 1st one right now) is using
// https://docs.apryse.com/api/web/7.3/WebViewerInstance.html#dangerouslySetNoteTransformFunction__anchor
dangerouslySetNoteTransformFunction

Any help will be appreciated.
Thank you guys.

Thank you.

@bollain
Copy link
Collaborator

bollain commented Dec 11, 2023

Hi @guiu57023,

Thanks for taking the time to submit this. I will add this as a feature request to our backlog. Do you have an example of a custom plugin you currently use or would like to use? I can include this as part of our testing/acceptance criteria to ensure it works.

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

No branches or pull requests

2 participants