As ever, turns it's always more complicated than thought. For instance jQuery, even with $.datepicker.formatDate, is not able to format a date + time correctly :/ So I added a new js script: date.format-1.2.3.js. It's only 4kb, I tried to compress it online, did not work, gave up. This is pretty basic, enough for the needs and can be easily extended when more is needed 5 mins later: Yikes, this was pretty stupid. I completly forgot about what I thought 2 weeks ago: it's from the server I need the date-time, so I need a json service. Then, today, I completly forgot about it, and thought again: OK, it will consume less ressources w/out a service, if I only use javascript. A senior moment I guess :/ I will rewrite that later, to have the real server hour... However, the mechanism I quickly built can still be pretty useful in some cases... git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1426848 13f79535-47bb-0310-9956-ffa450edef68
26 lines
1.0 KiB
Plaintext
26 lines
1.0 KiB
Plaintext
<#--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
<script type="text/javascript">
|
|
jQuery(document).ready(function() {
|
|
window.setInterval(function(){clock()}, 1000);
|
|
function clock() {
|
|
jQuery("#${clockField}").text("${uiLabelMap.CommonServerHour}: " + new Date().format("yyyy-mm-dd HH:MM:ss"));
|
|
}
|
|
})
|
|
</script> |