Changeset 5423 for trunk/www/common/annotations/annotate.jsp
- Timestamp:
- Sep 23, 2010, 11:09:55 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/common/annotations/annotate.jsp
r5075 r5423 2 2 ------------------------------------------------------------------ 3 3 Copyright (C) 2005 Nicklas Nordborg 4 Copyright (C) 2006 Jari H äkkinen, Nicklas Nordborg4 Copyright (C) 2006 Jari H�kkinen, Nicklas Nordborg 5 5 Copyright (C) 2007 Nicklas Nordborg 6 6 … … 88 88 String htmlDateFormat = HTML.encodeTags(dateFormat); 89 89 90 Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); 91 String dateTimeFormat = FormatterSettings.getDateTimeFormat(sc); 92 String jsDateTimeFormat = HTML.javaScriptEncode(dateTimeFormat); 93 String htmlDateTimeFormat = HTML.encodeTags(dateTimeFormat); 94 90 95 final Annotatable item = itemId == 0 ? null : (Annotatable)itemType.getById(dc, itemId); 91 96 final boolean writePermission = item == null ? true : item.hasPermission(Permission.WRITE); … … 190 195 List values = null; 191 196 Unit unit = at.getDefaultUnit(); 197 Type valueType = at.getValueType(); 192 198 if (existing != null && existing.containsKey(at)) 193 199 { … … 206 212 for (Object value : values) 207 213 { 208 if (value instanceof Date) value = dateFormatter.format((Date)value); 214 if (value instanceof Date) 215 { 216 if (valueType == Type.TIMESTAMP) 217 { 218 value = dateTimeFormatter.format((Date)value); 219 } 220 else 221 { 222 value = dateFormatter.format((Date)value); 223 } 224 } 209 225 %> 210 226 values[values.length] = '<%=HTML.javaScriptEncode(value.toString())%>'; … … 807 823 <% 808 824 } 825 else if (valueType == Type.TIMESTAMP) 826 { 827 %> 828 <table> 829 <tr> 830 <td> 831 <b><%=HTML.encodeTags(at.getName())%></b> (Timestamp)<br> 832 <input <%=clazz%> type="text" name="<%=inputName%>" value="" 833 size="30" maxlength="30" title="Enter date + time in format: <%=htmlDateTimeFormat%>" 834 onblur="valueOnBlur(this.value)"> 835 </td> 836 <td> 837 <br> 838 <base:button 839 onclick="<%="Dates.selectDateTime('Value', 'annotations', '"+inputName+"', 'setDateCallback', '"+jsDateTimeFormat+"')"%>" 840 image="calendar.png" 841 title="Calendar…" 842 tooltip="Select date and time from a calendar" 843 /> 844 </td> 845 </tr> 846 </table> 847 <% 848 } 809 849 if (at.supportUnits() && !at.isEnumeration()) 810 850 {
Note: See TracChangeset
for help on using the changeset viewer.