background preloader

Thetape

Facebook Twitter

Hosting

Imaging. Formatting date to client timezone. Unlike a locale information that is passed by browsers via HTTP header, there is no straightforward way to retrieve the information about client timezone offset.I also have not found any ready-to-use solutions to workaround this in web and one day when we've been posted the bug that our SMS sending times appears to be in the server timezone.

I've found the solution.The idea is pretty easy, the only way you can pass client timezone to the server is by calculating it using var tzo = new Date().getTimezoneOffset(); Next step - you need to pass it to the server, there is a number of ways to do it but they all have one drawback, you cannot format dates from the just loaded page, since script executes on the client.

Anyway the options are: Cookie and AJAX. The whole code on the client looks like <c:if test="${sessionScope['sonoportal.timezoneOffset'] == null}"><! We've also added the condition not to send cookie if we already have info about user timezone offset in the HttpSession. Thats all. Crop and resize images. TinyMCE Javascript Content Editor by Moxiecode Systems AB. Browse Design Job Listings. 20 pro tips - .net magazine. Country tag. UK Company Formation - Offshore Company Formations and Registrat. [#DISPL-92] Add support for javascript events on &lt;tr&gt; elem. I have done a similar thing as above but expanded on it. You can only highlight one row. We wanted to do that coz we only we wanted to apply some kind of action to that row only. /** * This JavaScript performs the task of highlighting a row in a displayTag table. /** * This function after the displayTag table has been created adds a onclick event * handler to each row in the table.

Rows[i].onmouseout = function() { this.style.cursor=''; }; rows[i].onclick = function() { //reset all styles to blank for all rows resetStylesAroundRow(this); this.style.backgroundColor = "#74BAB7"; var cell = this.getElementsByTagName("td")[0]; if (cell.getElementsByTagName("a").length > 0) { var link = cell.getElementsByTagName("a")[0]; if (link.onclick) { call = link.getAttributeValue("onclick"); // this will not work for links with onclick handlers that return false eval(call); } else { location.href = link.getAttribute("href"); } this.style.cursor="wait"; } }; } }

Isbndb.com - free ISBN database. Mastek Canoo Web Test.