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 Sample Welcome Form #654

Closed aaclage closed 1 year ago

aaclage commented 1 year ago
Q A
Bug fix? no
New sample? yes
Related issues? fixes #X, partially #Y, mentioned in #Z

What's in this Pull Request?

New Sample Welcome Form

aaclage commented 1 year ago

Hi @tecchan1107,

Thanks for the updates.

tecchan1107 commented 1 year ago

Hi @aaclage ! Sorry, please give me more time to verify😣🙏

aaclage commented 1 year ago

@tecchan1107 sure no problem :) take your time.

Enjoy the day :)

tecchan1107 commented 1 year ago

Hi, @aaclage ! Sorry for the delay.

I tried welcome-header-24hours.json. Looking at the code, it probably shows "Good Morning" from 5 AM to 12 AM, but when I looked at it at 7:41 AM, it showed "Good night". I am sorry, but could you please confirm or fix this phenomenon? image

The site locale is set to Japanese. image

I haven't checked all the times yet, but other times the message seems to be right on. image

aaclage commented 1 year ago

@tecchan1107 i will give a look thanks

aaclage commented 1 year ago

@tecchan1107 Strange made multiple validations and should work correctly, sample "txtContent": "='04:23:54'>'05:00:00'" with true for night and "txtContent": "='05:23:54'>'05:00:00'" for morning. I can only think as cache issue from last access....

tecchan1107 commented 1 year ago

@aaclage Thanks for the confirmation! I will check again after tomorrow, about the same time!

tecchan1107 commented 1 year ago

@aaclage I tried clearing the cache, but it still shows Good Night. Perhaps, but I think that the time is not correctly determined when the time is in single digits. 10 AM to 12 AM, the Good Morning is displayed correctly.

image

aaclage commented 1 year ago

@tecchan1107 ok i will review again. Can you test toLocaleTimeString(@now) before 10

tecchan1107 commented 1 year ago

The value of toLocaleTimeString(@now) is the following.

image

For reference, the indexOf value was displayed as the following.

image

aaclage commented 1 year ago

@tecchan1107 Ok i belive that found the issue have 10 character and should be 7, the logic is '4:23:54' doesn't have '0' should include in the begining that the time validation works as expected 10 characters was for 12 hours but 7 is for 24 hours. 4:23:54 -> 04:23:54 '04:23:54'>'05:00:00'

tecchan1107 commented 1 year ago

@aaclage Good Morning was displayed!!! Thanks for the fix🙏✨ image