BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
14.79k stars 1.86k forks source link

Changing date format #4007

Closed MehdiAliPak closed 12 months ago

MehdiAliPak commented 1 year ago

Attempted Debugging

Searched GitHub Issues

Describe the Scenario

hello guys, Is there any way to convert a Gregorian date to a solar one?

Exact BookStack Version

BookStack v22.11.1

Log Content

No response

PHP Version

8.2.0

Hosting Environment

localhost

ssddanbrown commented 1 year ago

Hi @MehdiAliPak, Sorry for my late response, had to check this myself.

It does not seem possible to use solar dates within BookStack.

MehdiAliPak commented 1 year ago

hello, thank you for your response. can't you just add this option? or is there any way to add solar date package into Carbon package?

ssddanbrown commented 1 year ago

It may be possible but I didn't see any direct/simple way that aligns with out usage. I wouldn't want to add too much for specific handling of solar dates, since it's had little demand. Depending upon what dates you're referencing, it may be possible to use our visual theme system to add custom conversion.

MehdiAliPak commented 1 year ago

hello sir, sorry I have another question how can I change the date picker in bookstack?, I tried to add some jalali datepicker but when I link the files in the head I get the below error:

Refused to load the script 'http://localhost:8080/dist/jalalidatepicker.js?version=v23.01' because it violates the following Content Security Policy directive: "script-src http: https: 'nonce-4PGmcFET3ePTAZ2NpVWA8vdx' 'strict-dynamic'". Note that 'strict-dynamic' is present, so host-based allowlisting is disabled. Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

what is the problem and is there anyway to fixt it?

ssddanbrown commented 1 year ago

@MehdiAliPak It really depends on how you're adding this. Scripts added to the "Custom HTML Head Content" customization setting get CSP (Content Security Policy) nonce's auto-added, Otherwise you'd have to go to steps to add this CSP nonce manually.

MehdiAliPak commented 1 year ago

Hello again, I could change the date picker but the problem is that I can not sort the Audit report, sorting is possible only with the original date picker, now what should I do?? is there any way to fix it??

ssddanbrown commented 1 year ago

Hi @MehdiAliPak, The default date-picker (Which is a default browser date field) has some added JavaScript logic to submit the parent form when the input is changed. Here's the logic that's used: https://github.com/BookStackApp/BookStack/blob/db791674691062c26e0073361ab731ed5c772713/resources/js/components/submit-on-change.js

ssddanbrown commented 12 months ago

Since there's been no further discussion here, and no further demand for solar dates, I'll close this off.