Cameron Posted October 30, 2015 Report Share Posted October 30, 2015 Hi all, I want to display only first letters of weekdays in my Calendar DataPages. I believe it's simple, but I cannot find the correct setting. Thank you for your time! Quote Link to comment Share on other sites More sharing options...
0 Walter Posted October 30, 2015 Report Share Posted October 30, 2015 Hello Cameron, I tried to find the setting, but I didn't find anything. I used the script code (add Header&Footer element, select the Footer, click the Source button and enter the code): <script> var header_cells = document.getElementsByTagName("th"); for (i = 0; i < header_cells.length; i++) { header_cells[i].innerHTML = header_cells[i].innerHTML.slice(0,1); } </script> I know, that it isn't the best solution, but it works. Quote Link to comment Share on other sites More sharing options...
0 Cameron Posted November 3, 2015 Author Report Share Posted November 3, 2015 Hi Walter, Thank you for your time! It works very good! But is it possible to change the names of weekdays not only to 1 letter, but also to two or three letters? Quote Link to comment Share on other sites More sharing options...
0 Walter Posted November 3, 2015 Report Share Posted November 3, 2015 Oh. You can use pairs of values and display "wanted" values instead of "current", it will be better. I have used the following script code: <script> var current_values = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; var wanted_values = ["Snd", "Mnd", "Tue", "Wdn", "Thu", "Fri", "Sat"]; var header_cells = document.getElementsByTagName("th"); for (i = 0; i < header_cells.length; i++) { for (n = 0; n < current_values.length; n++) { if(header_cells[i].innerHTML == current_values[n]) header_cells[i].innerHTML = wanted_values[n]; } } </script> You can enter your values instead of ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] and ["Snd", "Mnd", "Tue", "Wdn", "Thu", "Fri", "Sat"] In the result, the values from the second list will be displayed instead of correspond values of the first list. Quote Link to comment Share on other sites More sharing options...
Question
Cameron
Hi all,
I want to display only first letters of weekdays in my Calendar DataPages.
I believe it's simple, but I cannot find the correct setting.
Thank you for your time!
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.