pnp / List-Formatting

List Formatting Samples for use in SharePoint and Microsoft Lists
https://pnp.github.io/List-Formatting/
MIT License
1.71k stars 824 forks source link

New Column Formatting sample for Date Notation of a date and time column #641

Closed m3ngi3 closed 1 year ago

m3ngi3 commented 1 year ago
Q A
Bug fix? no
New sample? yes

What's in this Pull Request?

I added a sample to force the formatting / notation of a date and time column by unraveling the toLocaleTimeString() possibilities.

Guidance

You can delete this section when you are submitting the pull request.

Thanks for your contribution! Sharing is caring.

tecchan1107 commented 1 year ago

Hi @m3ngi3 . Thank you for the sample!!!

I am very sorry, but I have some concerns and would like to verify it, so please give me a little more time before merging. The following is what I would like to verify.

m3ngi3 commented 1 year ago

That is great @tecchan1107! Let me know if you can find specific locales not working --> I tested this in Dutch and English. I could add a disclaimer to the sample documentation to scope the sample if that would fit better? (I doubt if all Locales will be supported and if that is possible at all)

tecchan1107 commented 1 year ago

I think it's a good idea to put a disclaimer or note in the documentation (README)!

m3ngi3 commented 1 year ago

Something like my added note in the last commit. Is that enough @tecchan1107?

tecchan1107 commented 1 year ago

Thank you so much @m3ngi3 ! That is great!! Please wait until I have finished verifying and merging. Sorry😥

tecchan1107 commented 1 year ago

I merged them! Check out the following link. https://github.com/pnp/List-Formatting/tree/master/column-samples/date-notation

I also verified that it still did not display correctly in some locales, so I added a note about this to the README. image

In addition, I confirmed a phenomenon in which the date and time display changes depending on the time zone of the local PC, so I added that to the README. image

Once again, thanks for the great sample @m3ngi3 🙏✨

tecchan1107 commented 1 year ago

If you are interested, please register for the following program. When you register, you will get a digital badge! M365 Platform & Power Platform Community Recognition Program

※Even if you register, it will not be distributed immediately. It will take some time before it is distributed.

m3ngi3 commented 1 year ago

Thank you very much @tecchan1107! 🙏 Indeed not a perfect solution --> it would be better if there would be an expression out-of-the-box so formatting can be determined in an easy way like "dd-mm-yyyy HH:mm" just like in Power Apps and Power Automate.