Hi Jacques,
thanks for the nice localization. I was wondering should we also add the js files in format and locale folders also to LICENSE file? Bilgin [hidden email] wrote: > Author: jleroux > Date: Wed Dec 2 13:54:17 2009 > New Revision: 886143 > > URL: http://svn.apache.org/viewvc?rev=886143&view=rev > Log: > A patch from Sascha Rodekamp " Colors and localisation for the calendar" (https://issues.apache.org/jira/browse/OFBIZ-1825) - OFBIZ-1825 > Simple and clear implementation! > > Added: > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/ > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/ > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (with props) > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (with props) > Removed: > ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js > Modified: > ofbiz/trunk/LICENSE > ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl > ofbiz/trunk/framework/common/widget/CommonScreens.xml > ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl > ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl > ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml > > Modified: ofbiz/trunk/LICENSE > URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=886143&r1=886142&r2=886143&view=diff > ============================================================================== > --- ofbiz/trunk/LICENSE (original) > +++ ofbiz/trunk/LICENSE Wed Dec 2 13:54:17 2009 > @@ -1227,7 +1227,7 @@ > ofbiz/trunk/framework/jetty/lib/slf4j-api-1.3.1.jar > ofbiz/trunk/framework/jetty/lib/slf4j-log4j12-1.3.1.jar > ofbiz/trunk/framework/images/webapp/images/htmledit/whizzywig_v55i.js > -ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js > +ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js > ========================================================================= > The MIT License > > > Modified: ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl?rev=886143&r1=886142&r2=886143&view=diff > ============================================================================== > --- ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl (original) > +++ ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl Wed Dec 2 13:54:17 2009 > @@ -30,7 +30,8 @@ > <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/scriptaculous.js</@ofbizContentUrl>" type="text/javascript"></script> > <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" type="text/javascript"></script> > <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" type="text/javascript"></script> > - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script> > + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script> > + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" type="text/javascript"></script> > <#if layoutSettings.javaScripts?has_content> > <#--layoutSettings.javaScripts is a list of java scripts. --> > <#-- use a Set to make sure each javascript is declared only once, but iterate the list to maintain the correct order --> > > Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff > ============================================================================== > --- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original) > +++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 > @@ -118,7 +118,8 @@ > <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> > <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> > <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> > - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> > + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" global="true"/> > + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> > <set field="layoutSettings.javaScripts[]" value="/images/GooglemapMarkers.js" global="true"/> > <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" default-value="main" global="true"/> > <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" default-value="BIZZNESS_TIME" global="true"/> > @@ -289,7 +290,8 @@ > <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> > <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> > <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/> > - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> > + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" global="true"/> > + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> > <set field="layoutSettings.javaScripts[]" value="/images/GooglemapSimple.js" global="true"/> > <!-- The default (global) shortcut icon --> > <set field="layoutSettings.shortcutIcon" value="/images/ofbiz.ico" global="true"/> > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,464 @@ > +// CalendarDateSelect version 1.15 - a prototype based date picker > +// Questions, comments, bugs? - see the project page: http://code.google.com/p/calendardateselect > +if (typeof Prototype == 'undefined') alert("CalendarDateSelect Error: Prototype could not be found. Please make sure that your application's layout includes prototype.js (.g. <%= javascript_include_tag :defaults %>) *before* it includes calendar_date_select.js (.g. <%= calendar_date_select_includes %>)."); > +if (Prototype.Version < "1.6") alert("Prototype 1.6.0 is required. If using earlier version of prototype, please use calendar_date_select version 1.8.3"); > + > +Element.addMethods({ > + purgeChildren: function(element) { $A(element.childNodes).each(function(e){$(e).remove();}); }, > + build: function(element, type, options, style) { > + var newElement = Element.buildAndAppend(type, options, style); > + element.appendChild(newElement); > + return newElement; > + } > +}); > + > +Element.buildAndAppend = function(type, options, style) > +{ > + var e = $(document.createElement(type)); > + $H(options).each(function(pair) { e[pair.key] = pair.value }); > + if (style) e.setStyle(style); > + return e; > +}; > +nil = null; > + > +Date.one_day = 24*60*60*1000; > +Date.weekdays = $w("S M T W T F S"); > +Date.first_day_of_week = 0; > +Date.months = $w("January February March April May June July August September October November December" ); > +Date.padded2 = function(hour) { var padded2 = parseInt(hour, 10); if (hour < 10) padded2 = "0" + padded2; return padded2; } > +Date.prototype.getPaddedMinutes = function() { return Date.padded2(this.getMinutes()); } > +Date.prototype.getAMPMHour = function() { var hour = this.getHours(); return (hour == 0) ? 12 : (hour > 12 ? hour - 12 : hour ) } > +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "AM" : "PM"; } > +Date.prototype.stripTime = function() { return new Date(this.getFullYear(), this.getMonth(), this.getDate());}; > +Date.prototype.daysDistance = function(compare_date) { return Math.round((compare_date - this) / Date.one_day); }; > +Date.prototype.toFormattedString = function(include_time){ > + var hour, str; > + str = Date.months[this.getMonth()] + " " + this.getDate() + ", " + this.getFullYear(); > + > + if (include_time) { hour = this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() } > + return str; > +} > +/* mod for OFBiz Date Field */ > + Date.prototype.toFormattedString_ofbiz_default = function(include_time){ > + var hour, str; > + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); > + > + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + ":" + this.getSeconds() + "." + this.getMilliseconds() } > + return str; > +} > +/* mod end*/ > +Date.parseFormattedString = function(string) { return new Date(string);} > +Math.floor_to_interval = function(n, i) { return Math.floor(n/i) * i;} > +window.f_height = function() { return( [window.innerHeight ? window.innerHeight : null, document.documentElement ? document.documentElement.clientHeight : null, document.body ? document.body.clientHeight : null].select(function(x){return x>0}).first()||0); } > +window.f_scrollTop = function() { return ([window.pageYOffset ? window.pageYOffset : null, document.documentElement ? document.documentElement.scrollTop : null, document.body ? document.body.scrollTop : null].select(function(x){return x>0}).first()||0 ); } > + > +_translations = { > + "OK": "OK", > + "Now": "Now", > + "Today": "Today", > + "Clear": "Clear" > +} > +SelectBox = Class.create(); > +SelectBox.prototype = { > + initialize: function(parent_element, values, html_options, style_options) { > + this.element = $(parent_element).build("select", html_options, style_options); > + this.populate(values); > + }, > + populate: function(values) { > + this.element.purgeChildren(); > + var that = this; $A(values).each(function(pair) { if (typeof(pair)!="object") {pair = [pair, pair]}; that.element.build("option", { value: pair[1], innerHTML: pair[0]}) }); > + }, > + setValue: function(value) { > + var e = this.element; > + var matched = false; > + $R(0, e.options.length - 1 ).each(function(i) { if(e.options[i].value==value.toString()) {e.selectedIndex = i; matched = true;}; } ); > + return matched; > + }, > + getValue: function() { return $F(this.element)} > +} > +CalendarDateSelect = Class.create(); > +CalendarDateSelect.prototype = { > + initialize: function(target_element, options) { > + this.target_element = $(target_element); // make sure it's an element, not a string > + if (!this.target_element) { alert("Target element " + target_element + " not found!"); return false;} > + if (this.target_element.tagName != "INPUT") this.target_element = this.target_element.down("INPUT") > + > + this.target_element.calendar_date_select = this; > + this.last_click_at = 0; > + // initialize the date control > + this.options = $H({ > + embedded: false, > + popup: nil, > + time: false, > + buttons: true, > + clear_button: true, > + year_range: 10, > + close_on_click: nil, > + minute_interval: 5, > + popup_by: this.target_element, > + month_year: "dropdowns", > + onchange: this.target_element.onchange, > + valid_date_check: nil > + }).merge(options || {}); > + this.use_time = this.options.get("time"); > + this.parseDate(); > + this.callback("before_show") > + this.initCalendarDiv(); > + if(!this.options.get("embedded")) { > + this.positionCalendarDiv() > + // set the click handler to check if a user has clicked away from the document > + Event.observe(document, "mousedown", this.closeIfClickedOut_handler = this.closeIfClickedOut.bindAsEventListener(this)); > + Event.observe(document, "keypress", this.keyPress_handler = this.keyPress.bindAsEventListener(this)); > + } > + this.callback("after_show") > + }, > + positionCalendarDiv: function() { > + var above = false; > + var c_pos = this.calendar_div.cumulativeOffset(), c_left = c_pos[0], c_top = c_pos[1], c_dim = this.calendar_div.getDimensions(), c_height = c_dim.height, c_width = c_dim.width; > + var w_top = window.f_scrollTop(), w_height = window.f_height(); > + var e_dim = $(this.options.get("popup_by")).cumulativeOffset(), e_top = e_dim[1], e_left = e_dim[0], e_height = $(this.options.get("popup_by")).getDimensions().height, e_bottom = e_top + e_height; > + > + if ( (( e_bottom + c_height ) > (w_top + w_height)) && ( e_bottom - c_height > w_top )) above = true; > + var left_px = e_left.toString() + "px", top_px = (above ? (e_top - c_height ) : ( e_top + e_height )).toString() + "px"; > + > + this.calendar_div.style.left = left_px; this.calendar_div.style.top = top_px; > + > + this.calendar_div.setStyle({visibility:""}); > + > + // draw an iframe behind the calendar -- ugly hack to make IE 6 happy > + if(navigator.appName=="Microsoft Internet Explorer") this.iframe = $(document.body).build("iframe", {src: "javascript:false", className: "ie6_blocker"}, { left: left_px, top: top_px, height: c_height.toString()+"px", width: c_width.toString()+"px", border: "0px"}) > + }, > + initCalendarDiv: function() { > + if (this.options.get("embedded")) { > + var parent = this.target_element.parentNode; > + var style = {} > + } else { > + var parent = document.body > + var style = { position:"absolute", visibility: "hidden", left:0, top:0 } > + } > + this.calendar_div = $(parent).build('div', {className: "calendar_date_select"}, style); > + > + var that = this; > + // create the divs > + $w("top header body buttons footer bottom").each(function(name) { > + eval("var " + name + "_div = that." + name + "_div = that.calendar_div.build('div', { className: 'cds_"+name+"' }, { clear: 'left'} ); "); > + }); > + > + this.initHeaderDiv(); > + this.initButtonsDiv(); > + this.initCalendarGrid(); > + this.updateFooter(" "); > + > + this.refresh(); > + this.setUseTime(this.use_time); > + }, > + initHeaderDiv: function() { > + var header_div = this.header_div; > + this.close_button = header_div.build("a", { innerHTML: "x", href:"#", onclick:function () { this.close(); return false; }.bindAsEventListener(this), className: "close" }); > + this.next_month_button = header_div.build("a", { innerHTML: ">", href:"#", onclick:function () { this.navMonth(this.date.getMonth() + 1 ); return false; }.bindAsEventListener(this), className: "next" }); > + this.prev_month_button = header_div.build("a", { innerHTML: "<", href:"#", onclick:function () { this.navMonth(this.date.getMonth() - 1 ); return false; }.bindAsEventListener(this), className: "prev" }); > + > + if (this.options.get("month_year")=="dropdowns") { > + this.month_select = new SelectBox(header_div, $R(0,11).map(function(m){return [Date.months[m], m]}), {className: "month", onchange: function () { this.navMonth(this.month_select.getValue()) }.bindAsEventListener(this)}); > + this.year_select = new SelectBox(header_div, [], {className: "year", onchange: function () { this.navYear(this.year_select.getValue()) }.bindAsEventListener(this)}); > + this.populateYearRange(); > + } else { > + this.month_year_label = header_div.build("span") > + } > + }, > + initCalendarGrid: function() { > + var body_div = this.body_div; > + this.calendar_day_grid = []; > + var days_table = body_div.build("table", { cellPadding: "0px", cellSpacing: "0px", width: "100%" }) > + // make the weekdays! > + var weekdays_row = days_table.build("thead").build("tr"); > + Date.weekdays.each( function(weekday) { > + weekdays_row.build("th", {innerHTML: weekday}); > + }); > + > + var days_tbody = days_table.build("tbody") > + // Make the days! > + var row_number = 0, weekday; > + for(var cell_index = 0; cell_index<42; cell_index++) > + { > + weekday = (cell_index+Date.first_day_of_week ) % 7; > + if ( cell_index % 7==0 ) days_row = days_tbody.build("tr", {className: 'row_'+row_number++}); > + (this.calendar_day_grid[cell_index] = days_row.build("td", { > + calendar_date_select: this, > + onmouseover: function () { this.calendar_date_select.dayHover(this); }, > + onmouseout: function () { this.calendar_date_select.dayHoverOut(this) }, > + onclick: function() { this.calendar_date_select.updateSelectedDate(this, true); }, > + className: (weekday==0) || (weekday==6) ? " weekend" : "" //clear the class > + }, > + { cursor: "pointer" } > + )).build("div"); > + this.calendar_day_grid[cell_index]; > + } > + }, > + initButtonsDiv: function() > + { > + var buttons_div = this.buttons_div; > + if (this.options.get("time")) > + { > + var blank_time = $A(this.options.get("time")=="mixed" ? [[" - ", ""]] : []); > + buttons_div.build("span", {innerHTML:"@", className: "at_sign"}); > + > + var t = new Date(); > + this.hour_select = new SelectBox(buttons_div, > + blank_time.concat($R(0,23).map(function(x) {t.setHours(x); return $A([t.getAMPMHour()+ " " + t.getAMPM(),x])} )), > + { > + calendar_date_select: this, > + onchange: function() { this.calendar_date_select.updateSelectedDate( { hour: this.value });}, > + className: "hour" > + } > + ); > + buttons_div.build("span", {innerHTML:":", className: "seperator"}); > + var that = this; > + this.minute_select = new SelectBox(buttons_div, > + blank_time.concat($R(0,59).select(function(x){return (x % that.options.get('minute_interval')==0)}).map(function(x){ return $A([ Date.padded2(x), x]); } ) ), > + { > + calendar_date_select: this, > + onchange: function() { this.calendar_date_select.updateSelectedDate( {minute: this.value }) }, > + className: "minute" > + } > + ); > + > + } else if (! this.options.get("buttons")) buttons_div.remove(); > + > + if (this.options.get("buttons")) { > + buttons_div.build("span", {innerHTML: " "}); > + if (this.options.get("time")=="mixed" || !this.options.get("time")) b = buttons_div.build("a", { > + innerHTML: _translations["Today"], > + href: "#", > + onclick: function() {this.today(false); return false;}.bindAsEventListener(this) > + }); > + > + if (this.options.get("time")=="mixed") buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) > + > + if (this.options.get("time")) b = buttons_div.build("a", { > + innerHTML: _translations["Now"], > + href: "#", > + onclick: function() {this.today(true); return false}.bindAsEventListener(this) > + }); > + > + if (!this.options.get("embedded") && !this.closeOnClick()) > + { > + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) > + buttons_div.build("a", { innerHTML: _translations["OK"], href: "#", onclick: function() {this.close(); return false;}.bindAsEventListener(this) }); > + } > + if (this.options.get('clear_button')) { > + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) > + buttons_div.build("a", { innerHTML: _translations["Clear"], href: "#", onclick: function() {this.clearDate(); if (!this.options.get("embedded")) this.close(); return false;}.bindAsEventListener(this) }); > + } > + } > + }, > + refresh: function () > + { > + this.refreshMonthYear(); > + this.refreshCalendarGrid(); > + > + this.setSelectedClass(); > + this.updateFooter(); > + }, > + refreshCalendarGrid: function () { > + this.beginning_date = new Date(this.date).stripTime(); > + this.beginning_date.setDate(1); > + this.beginning_date.setHours(12); // Prevent daylight savings time boundaries from showing a duplicate day > + var pre_days = this.beginning_date.getDay() // draw some days before the fact > + if (pre_days < 3) pre_days += 7; > + this.beginning_date.setDate(1 - pre_days + Date.first_day_of_week); > + > + var iterator = new Date(this.beginning_date); > + > + var today = new Date().stripTime(); > + var this_month = this.date.getMonth(); > + vdc = this.options.get("valid_date_check"); > + for (var cell_index = 0;cell_index<42; cell_index++) > + { > + day = iterator.getDate(); month = iterator.getMonth(); > + cell = this.calendar_day_grid[cell_index]; > + Element.remove(cell.childNodes[0]); div = cell.build("div", {innerHTML:day}); > + if (month!=this_month) div.className = "other"; > + cell.day = day; cell.month = month; cell.year = iterator.getFullYear(); > + if (vdc) { if (vdc(iterator.stripTime())) cell.removeClassName("disabled"); else cell.addClassName("disabled") }; > + iterator.setDate( day + 1); > + } > + > + if (this.today_cell) this.today_cell.removeClassName("today"); > + > + if ( $R( 0, 41 ).include(days_until = this.beginning_date.stripTime().daysDistance(today)) ) { > + this.today_cell = this.calendar_day_grid[days_until]; > + this.today_cell.addClassName("today"); > + } > + }, > + refreshMonthYear: function() { > + var m = this.date.getMonth(); > + var y = this.date.getFullYear(); > + // set the month > + if (this.options.get("month_year") == "dropdowns") > + { > + this.month_select.setValue(m, false); > + > + var e = this.year_select.element; > + if (this.flexibleYearRange() && (!(this.year_select.setValue(y, false)) || e.selectedIndex <= 1 || e.selectedIndex >= e.options.length - 2 )) this.populateYearRange(); > + > + this.year_select.setValue(y); > + > + } else { > + this.month_year_label.update( Date.months[m] + " " + y.toString() ); > + } > + }, > + populateYearRange: function() { > + this.year_select.populate(this.yearRange().toArray()); > + }, > + yearRange: function() { > + if (!this.flexibleYearRange()) > + return $R(this.options.get("year_range")[0], this.options.get("year_range")[1]); > + > + var y = this.date.getFullYear(); > + return $R(y - this.options.get("year_range"), y + this.options.get("year_range")); > + }, > + flexibleYearRange: function() { return (typeof(this.options.get("year_range")) == "number"); }, > + validYear: function(year) { if (this.flexibleYearRange()) { return true;} else { return this.yearRange().include(year);} }, > + dayHover: function(element) { > + var hover_date = new Date(this.selected_date); > + hover_date.setYear(element.year); hover_date.setMonth(element.month); hover_date.setDate(element.day); > + this.updateFooter(hover_date.toFormattedString(this.use_time)); > + }, > + dayHoverOut: function(element) { this.updateFooter(); }, > + clearSelectedClass: function() {if (this.selected_cell) this.selected_cell.removeClassName("selected");}, > + setSelectedClass: function() { > + if (!this.selection_made) return; > + this.clearSelectedClass() > + if ($R(0,42).include( days_until = this.beginning_date.stripTime().daysDistance(this.selected_date.stripTime()) )) { > + this.selected_cell = this.calendar_day_grid[days_until]; > + this.selected_cell.addClassName("selected"); > + } > + }, > + reparse: function() { this.parseDate(); this.refresh(); }, > + dateString: function() { > + //mod for ofbiz Date input field, the return value will not be localized. > + //return (this.selection_made) ? this.selected_date.toFormattedString(this.use_time) : " "; > + return (this.selection_made) ? this.selected_date.toFormattedString_ofbiz_default(this.use_time) : " "; > + }, > + parseDate: function() > + { > + var value = $F(this.target_element).strip() > + this.selection_made = (value != ""); > + this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value); > + if (isNaN(this.date)) this.date = new Date(); > + if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? this.yearRange().start : this.yearRange().end); > + this.selected_date = new Date(this.date); > + this.use_time = /[0-9]:[0-9]{2}/.exec(value) ? true : false; > + this.date.setDate(1); > + }, > + updateFooter:function(text) { if (!text) text = this.dateString(); this.footer_div.purgeChildren(); this.footer_div.build("span", {innerHTML: text }); }, > + clearDate:function() { > + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; > + var last_value = this.target_element.value; > + this.target_element.value = ""; > + this.clearSelectedClass(); > + this.updateFooter(' '); > + if (last_value!=this.target_element.value) this.callback("onchange"); > + }, > + updateSelectedDate:function(partsOrElement, via_click) { > + var parts = $H(partsOrElement); > + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; > + if (parts.get("day")) { > + var t_selected_date = this.selected_date, vdc = this.options.get("valid_date_check"); > + for (var x = 0; x<=3; x++) t_selected_date.setDate(parts.get("day")); > + t_selected_date.setYear(parts.get("year")); > + t_selected_date.setMonth(parts.get("month")); > + > + if (vdc && ! vdc(t_selected_date.stripTime())) { return false; } > + this.selected_date = t_selected_date; > + this.selection_made = true; > + } > + > + if (!isNaN(parts.get("hour"))) this.selected_date.setHours(parts.get("hour")); > + if (!isNaN(parts.get("minute"))) this.selected_date.setMinutes( Math.floor_to_interval(parts.get("minute"), this.options.get("minute_interval")) ); > + if (parts.get("hour") === "" || parts.get("minute") === "") > + this.setUseTime(false); > + else if (!isNaN(parts.get("hour")) || !isNaN(parts.get("minute"))) > + this.setUseTime(true); > + > + this.updateFooter(); > + this.setSelectedClass(); > + > + if (this.selection_made) this.updateValue(); > + if (this.closeOnClick()) { this.close(); } > + if (via_click && !this.options.get("embedded")) { > + if ((new Date() - this.last_click_at) < 333) this.close(); > + this.last_click_at = new Date(); > + } > + }, > + closeOnClick: function() { > + if (this.options.get("embedded")) return false; > + if (this.options.get("close_on_click")===nil ) > + return (this.options.get("time")) ? false : true > + else > + return (this.options.get("close_on_click")) > + }, > + navMonth: function(month) { (target_date = new Date(this.date)).setMonth(month); return (this.navTo(target_date)); }, > + navYear: function(year) { (target_date = new Date(this.date)).setYear(year); return (this.navTo(target_date)); }, > + navTo: function(date) { > + if (!this.validYear(date.getFullYear())) return false; > + this.date = date; > + this.date.setDate(1); > + this.refresh(); > + this.callback("after_navigate", this.date); > + return true; > + }, > + setUseTime: function(turn_on) { > + this.use_time = this.options.get("time") && (this.options.get("time")=="mixed" ? turn_on : true) // force use_time to true if time==true && time!="mixed" > + if (this.use_time && this.selected_date) { // only set hour/minute if a date is already selected > + var minute = Math.floor_to_interval(this.selected_date.getMinutes(), this.options.get("minute_interval")); > + var hour = this.selected_date.getHours(); > + > + this.hour_select.setValue(hour); > + this.minute_select.setValue(minute) > + } else if (this.options.get("time")=="mixed") { > + this.hour_select.setValue(""); this.minute_select.setValue(""); > + } > + }, > + updateValue: function() { > + var last_value = this.target_element.value; > + this.target_element.value = this.dateString(); > + if (last_value!=this.target_element.value) this.callback("onchange"); > + }, > + today: function(now) { > + var d = new Date(); this.date = new Date(); > + var o = $H({ day: d.getDate(), month: d.getMonth(), year: d.getFullYear(), hour: d.getHours(), minute: d.getMinutes()}); > + if ( ! now ) o = o.merge({hour: "", minute:""}); > + this.updateSelectedDate(o, true); > + this.refresh(); > + }, > + close: function() { > + if (this.closed) return false; > + this.callback("before_close"); > + this.target_element.calendar_date_select = nil; > + Event.stopObserving(document, "mousedown", this.closeIfClickedOut_handler); > + Event.stopObserving(document, "keypress", this.keyPress_handler); > + this.calendar_div.remove(); this.closed = true; > + if (this.iframe) this.iframe.remove(); > + if (this.target_element.type != "hidden" && ! this.target_element.disabled) this.target_element.focus(); > + this.callback("after_close"); > + }, > + closeIfClickedOut: function(e) { > + if (! $(Event.element(e)).descendantOf(this.calendar_div) ) this.close(); > + }, > + keyPress: function(e) { > + if (e.keyCode==Event.KEY_ESC) this.close(); > + }, > + callback: function(name, param) { if (this.options.get(name)) { this.options.get(name).bind(this.target_element)(param); } } > +} > + > + > +//OFBiz addition: functions to call the calendar > +function call_cal(target, datetime) { > + new CalendarDateSelect(target, {time:true,year_range:10} ); > +} > + > +function call_cal_notime(target, datetime) { > + new CalendarDateSelect(target, {time:false,year_range:10} ); > +} > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,34 @@ > +// American Format: 12/31/2000 5:00 pm > +// Thanks, Wes Hays > +Date.prototype.toFormattedString = function(include_time){ > + str = Date.padded2(this.getMonth() + 1) + '/' +Date.padded2(this.getDate()) + '/' + this.getFullYear(); > + > + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() } > + return str; > +} > + > +Date.parseFormattedString = function (string) { > + // Test these with and without the time > + // 11/11/1111 12pm > + // 11/11/1111 1pm > + // 1/11/1111 10:10pm > + // 11/1/1111 01pm > + // 1/1/1111 01:11pm > + // 1/1/1111 1:11pm > + var regexp = "(([0-1]?[0-9])\/[0-3]?[0-9]\/[0-9]{4}) *([0-9]{1,2}(:[0-9]{2})? *(am|pm))?"; > + var d = string.match(new RegExp(regexp, "i")); > + if (d==null) { > + return Date.parse(string); // Give javascript a chance to parse it. > + } > + > + mdy = d[1].split('/'); > + hrs = 0; > + mts = 0; > + if(d[3] != null) { > + hrs = parseInt(d[3].split('')[0], 10); > + if(d[5].toLowerCase() == 'pm') { hrs += 12; } // Add 12 more to hrs > + mts = d[4].split(':')[1]; > + } > + > + return new Date(mdy[2], parseInt(mdy[0], 10)-1, mdy[1], hrs, mts, 0); > +} > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,27 @@ > +// DB No Seconds Format: 2007-12-05 12:00 > + > +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; } > +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } > +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } > + > +Date.prototype.toFormattedString = function(include_time){ > + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); > + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } > + return str; > +} > + > +Date.parseFormattedString = function (string) { > + var regexp = '([0-9]{4})-(([0-9]{1,2})-(([0-9]{1,2})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; > + var d = string.match(new RegExp(regexp, "i")); > + if (d==null) return Date.parse(string); // at least give javascript a crack at it. > + var offset = 0; > + var date = new Date(d[1], 0, 1); > + if (d[3]) { date.setMonth(d[3] - 1); } > + if (d[5]) { date.setDate(d[5]); } > + if (d[7]) { > + date.setHours(parseInt(d[7], 10)); > + } > + if (d[8]) { date.setMinutes(d[8]); } > + if (d[10]) { date.setSeconds(d[10]); } > + return date; > +} > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,12 @@ > +// Time Format as "17:00" in DropDown Box > +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; } > +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } > +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } > + > +// Formats date and time as "01 January 2000 17:00" > +Date.prototype.toFormattedString = function(include_time) > +{ > + str = Date.padded2(this.getDate()) + " " + Date.months[this.getMonth()] + " " + this.getFullYear(); > + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } > + return str; > +} > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,12 @@ > +// Time Format as "17:00" in DropDown Box > +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; } > +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } > +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } > + > +// Formats date and time as "2000.01.20 17:00" > +Date.prototype.toFormattedString = function(include_time) > +{ > + str = this.getFullYear() + "." + Date.padded2(this.getMonth()+1) + "." + Date.padded2(this.getDate()); > + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } > + return str; > +} > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,33 @@ > +// Time Format as "17:00" in DropDown Box > +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; } > +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } > +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } > + > +Date.prototype.toFormattedString = function(include_time){ > + str = this.getDate() + "." + (this.getMonth() + 1) + "." + this.getFullYear(); > + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } > + return str; > +} > +Date.parseFormattedString = function (string) { > + var regexp = '([0-9]{1,2})\.(([0-9]{1,2})\.(([0-9]{2,4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; > + var d = string.match(new RegExp(regexp, "i")); > + if (d==null) return Date.parse(string); // at least give javascript a crack at it. > + var offset = 0; > + if (d[5] && d[5].length == 2) { > + // we got only two digits for the year... > + d[5] = Number(d[5]); > + if (d[5] > 30) > + d[5] += 1900; > + else > + d[5] += 2000; > + } > + var date = new Date(d[5], 0, 1); > + if (d[3]) { date.setMonth(d[3] - 1); } > + if (d[5]) { date.setDate(d[1]); } > + if (d[7]) { > + date.setHours(parseInt(d[7], 10)); > + } > + if (d[8]) { date.setMinutes(d[8]); } > + if (d[10]) { date.setSeconds(d[10]); } > + return date; > +} > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,37 @@ > +Date.prototype.toFormattedString = function(include_time){ > + str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); > + > +if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() } > +return str; > +} > + > +Date.parseFormattedString = function (string) { > + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + > + "( ([0-9]{1,2}):([0-9]{2})? *(pm|am)" + > + "?)?)?)?"; > + var d = string.match(new RegExp(regexp, "i")); > + if (d==null) return Date.parse(string); // at least give javascript a crack at it. > + var offset = 0; > + var date = new Date(d[1], 0, 1); > + if (d[3]) { date.setMonth(d[3] - 1); } > + if (d[5]) { date.setDate(d[5]); } > + if (d[7]) { > + hours = parseInt(d[7], 10); > + offset=0; > + if (d[9]) { > + is_pm = (d[9].toLowerCase()=="pm"); > + if (is_pm && hours <= 11) hours+=12; > + if (!is_pm && hours == 12) hours=0; > + } > + date.setHours(hours); > + } > + if (d[8]) { date.setMinutes(d[8]); } > + if (d[10]) { date.setSeconds(d[10]); } > + if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); } > + if (d[14]) { > + offset = (Number(d[16]) * 60) + Number(d[17]); > + offset *= ((d[15] == '-') ? 1 : -1); > + } > + > + return date; > +} > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,46 @@ > +Date.prototype.toFormattedString = function(include_time) { > + var hour; > + var str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); > + if (include_time) { > + hour = this.getHours(); > + str += " " + this.getHours() + ":" + this.getPaddedMinutes(); > + } > + return str; > +}; > + > +Date.parseFormattedString = function (string) { > + > + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + > + "( ([0-9]{1,2}):([0-9]{2})?" + > + "?)?)?)?"; > + > + var d = string.match(new RegExp(regexp, "i")); > + if (d === null) { > + return Date.parse(string); // at least give javascript a crack at it. > + } > + var offset = 0; > + var date = new Date(d[1], 0, 1); > + if (d[3]) { > + date.setMonth(d[3] - 1); > + } > + if (d[5]) { > + date.setDate(d[5]); > + } > + if (d[7]) { > + date.setHours(d[7]); > + } > + if (d[8]) { > + date.setMinutes(d[8]); > + } > + if (d[0]) { > + date.setSeconds(d[0]); > + } > + if (d[2]) { > + date.setMilliseconds(Number("0." + d[2])); > + } > + if (d[4]) { > + offset = (Number(d[6])) + Number(d[8]); > + offset = ((d[5] == '-') ? 1 : -1); > + } > + return date; > +}; > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,24 @@ > +// Italian Format: 31/12/2000 23:00 > +// Thanks, Bigonazzi! > + > +Date.prototype.toFormattedString = function(include_time){ > + str = this.getDate() + "/" + (this.getMonth() + 1) + "/" + this.getFullYear(); > + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } > + return str; > +} > + > +Date.parseFormattedString = function (string) { > + var regexp = '([0-9]{1,2})/(([0-9]{1,2})/(([0-9]{4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; > + var d = string.match(new RegExp(regexp, "i")); > + if (d==null) return Date.parse(string); // at least give javascript a crack at it. > + var offset = 0; > + var date = new Date(d[5], 0, 1); > + if (d[3]) { date.setMonth(d[3] - 1); } > + if (d[5]) { date.setDate(d[1]); } > + if (d[7]) { > + date.setHours(parseInt(d[7], 10)); > + } > + if (d[8]) { date.setMinutes(d[8]); } > + if (d[10]) { date.setSeconds(d[10]); } > + return date; > +} > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,19 @@ > +Date.weekdays = $w('Mo Di Mi Do Fr Sa So'); > +Date.months = $w('Januar Februar März April Mai Juni Juli August September Oktober November Dezember'); > + > +Date.first_day_of_week = 1; > + > +_translations = { > + "OK": "OK", > + "Now": "Jetzt", > + "Today": "Heute", > + "Clear": "Löschen" > +} > + > +//load the data format > +var dataFormatJs = "format_euro_24hr.js" > + > +var e = document.createElement("script"); > +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; > +e.type="text/javascript"; > +document.getElementsByTagName("head")[0].appendChild(e); > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,11 @@ > +Date.weekdays = $w("L M X J V S D"); > +Date.months = $w("Enero Febrero Marzo Abril Mayo Junio Julio Agosto Septiembre Octubre Noviembre Diciembre" ); > + > +Date.first_day_of_week = 1; > + > +_translations = { > + "OK": "Cancelar", > + "Now": "Ahora", > + "Clear": "Limpiar", > + "Today": "Hoy" > +} > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,10 @@ > +Date.weekdays = $w("Ma Ti Ke To Pe La Su"); > +Date.months = $w("Tammikuu Helmikuu Maaliskuu Huhtikuu Toukokuu Kesäkuu Heinäkuu Elokuu Syyskuu Lokakuu Marraskuu Joulukuu" ); > + > +Date.first_day_of_week = 1 > + > +_translations = { > + "OK": "OK", > + "Now": "Nyt", > + "Today": "Tänään" > +} > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,19 @@ > +Date.weekdays = $w('L Ma Me J V S D'); > +Date.months = $w('Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre'); > + > +Date.first_day_of_week = 1; > + > +_translations = { > + "OK": "OK", > + "Now": "Maintenant", > + "Today": "Aujourd'hui", > + "Clear": "Effacer" > +} > + > +//load the data format > +var dataFormatJs = "format_euro_24hr.js" > + > +var e = document.createElement("script"); > +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; > +e.type="text/javascript"; > +document.getElementsByTagName("head")[0].appendChild(e); > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,11 @@ > +Date.weekdays = $w('Ma Di Wo Do Vr Za Zo'); > +Date.months = $w('Januari Februari Maart April Mei Juni Juli Augustus September Oktober November December'); > + > +Date.first_day_of_week = 1; > + > +_translations = { > + "OK": "OK", > + "Now": "Nu", > + "Today": "Vandaag", > + "Clear": "Wissen" > +} > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,10 @@ > +Date.weekdays = $w('P W Å C P S N'); > +Date.months = $w('StyczeÅ Luty Marzec KwiecieÅ Maj Czerwiec Lipiec SierpieÅ WrzesieÅ Październik Listopad GrudzieÅ'); > + > +Date.first_day_of_week = 1 > + > +_translations = { > + "OK": "OK", > + "Now": "Teraz", > + "Today": "DziÅ" > +} > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,11 @@ > +Date.weekdays = $w('D S T Q Q S S'); > +Date.months = $w('Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro'); > + > +Date.first_day_of_week = 0 > + > +_translations = { > + "OK": "OK", > + "Now": "Agora", > + "Today": "Hoje", > + "Clear": "Limpar" > +} > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,10 @@ > +Date.weekdays = $w('Ðн ÐÑ Ð¡Ñ Ð§Ñ ÐÑ Ð¡Ð± ÐÑ?'); > +Date.months = $w('ЯнваÑÑ Ð¤ÐµÐ²ÑÐ°Ð»Ñ ÐаÑÑ Ð?пÑÐµÐ»Ñ Ðай ÐÑÐ½Ñ ÐÑÐ»Ñ Ð?вгÑÑ?Ñ Ð¡ÐµÐ½ÑÑ?бÑÑ ÐкÑÑ?бÑÑ Ð?оÑ?бÑÑ ÐекабÑÑ'); > + > +Date.first_day_of_week = 1 > + > +_translations = { > + "OK": "OK", > + "Now": "СейÑаÑ?", > + "Today": "СегоднÑ?" > +} > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js?rev=886143&view=auto > ============================================================================== > --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (added) > +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js Wed Dec 2 13:54:17 2009 > @@ -0,0 +1,10 @@ > +Date.weekdays = $w("? ? ? ? ? ? ?"); > +Date.months = $w("? ? ? ? ? ? ? ? ? ? ?? ??" ); > + > +Date.first_day_of_week = 1 > + > +_translations = { > + "OK": "??", > + "Now": "??", > + "Today": "??" > +} > \ No newline at end of file > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js > ------------------------------------------------------------------------------ > svn:keywords = "Date Rev Author URL Id" > > Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js > ------------------------------------------------------------------------------ > svn:mime-type = text/plain > > Modified: ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl?rev=886143&r1=886142&r2=886143&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl (original) > +++ ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl Wed Dec 2 13:54:17 2009 > @@ -26,8 +26,8 @@ > <script language="javascript" src="/images/prototypejs/prototype.js" type="text/javascript"></script> > <script language="javascript" src="/images/fieldlookup.js" type="text/javascript"></script> > <script language="javascript" src="/images/selectall.js" type="text/javascript"></script> > - <script language="javascript" src="/images/calendar_date_select.js" type="text/javascript"></script> > - > + <script language="javascript" src="/images/calendarDateSelect/calendar_date_select.js" type="text/javascript"></script> > + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" type="text/javascript"></script> > <link rel="stylesheet" href="/images/ecommain.css" type="text/css"/> > <link rel="stylesheet" href="/ecommerce/images/blog.css" type="text/css"/> > <link rel="stylesheet" href="/content/images/contentForum.css" type="text/css"/> > > Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl?rev=886143&r1=886142&r2=886143&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl (original) > +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl Wed Dec 2 13:54:17 2009 > @@ -24,7 +24,8 @@ > <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/prototype.js</@ofbizContentUrl>" type="text/javascript"></script> > <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" type="text/javascript"></script> > <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" type="text/javascript"></script> > - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script> > + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script> > + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale!}.js</@ofbizContentUrl>" type="text/javascript"></script> > <link rel='stylesheet' href='<@ofbizContentUrl>/images/maincss.css</@ofbizContentUrl>' type='text/css'> > <link rel='stylesheet' href='<@ofbizContentUrl>/images/tabstyles.css</@ofbizContentUrl>' type='text/css'> > <link rel='stylesheet' href='<@ofbizContentUrl>/ecommerce/images/blog.css</@ofbizContentUrl>' type='text/css'> > > Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml > URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff > ============================================================================== > --- ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml (original) > +++ ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 > @@ -41,7 +41,8 @@ > <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> > <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> > <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> > - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> > + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" global="true"/> > + <set field="layoutSettings.javaScripts[+0]" value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> > <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> > <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> > <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> > @@ -222,7 +223,7 @@ > </widgets> > </section> > </screen> > - > + > <screen name="CommonPopUpDecorator"> > <section> > <actions> > @@ -244,7 +245,8 @@ > <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> > <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> > <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> > - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> > + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" global="true"/> > + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> > <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> > <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> > <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> > > > |
Administrator
|
Actually thanks are for Sascha who did a great and quick job, Sascha is a student.
I tried with Hindi (proof : ;o) it works.. Jacques From: "Bilgin Ibryam" <[hidden email]> To: <[hidden email]> Sent: Thursday, December 03, 2009 9:34 AM Subject: Re: svn commit: r886143 - in /ofbiz/trunk: ./ framework/common/webcommon/includes/ framework/common/widget/ framework/images/webapp/images/ framework/images/webapp/images/calendarDateSelect/ framework/images/webapp/images/calendarDateSelect/format/ framewo... > Hi Jacques, > > thanks for the nice localization. > I was wondering should we also add the js files in format and locale > folders also to LICENSE file? > > Bilgin > > [hidden email] wrote: >> Author: jleroux >> Date: Wed Dec 2 13:54:17 2009 >> New Revision: 886143 >> >> URL: http://svn.apache.org/viewvc?rev=886143&view=rev >> Log: >> A patch from Sascha Rodekamp " Colors and localisation for the calendar" (https://issues.apache.org/jira/browse/OFBIZ-1825) - OFBIZ-1825 >> Simple and clear implementation! >> >> Added: >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/ >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/ >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (with props) >> Removed: >> ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js >> Modified: >> ofbiz/trunk/LICENSE >> ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl >> ofbiz/trunk/framework/common/widget/CommonScreens.xml >> ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl >> ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl >> ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml >> >> Modified: ofbiz/trunk/LICENSE >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/LICENSE (original) >> +++ ofbiz/trunk/LICENSE Wed Dec 2 13:54:17 2009 >> @@ -1227,7 +1227,7 @@ >> ofbiz/trunk/framework/jetty/lib/slf4j-api-1.3.1.jar >> ofbiz/trunk/framework/jetty/lib/slf4j-log4j12-1.3.1.jar >> ofbiz/trunk/framework/images/webapp/images/htmledit/whizzywig_v55i.js >> -ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js >> +ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ========================================================================= >> The MIT License >> >> >> Modified: ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl (original) >> +++ ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl Wed Dec 2 13:54:17 2009 >> @@ -30,7 +30,8 @@ >> <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/scriptaculous.js</@ofbizContentUrl>" type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" type="text/javascript"></script> >> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script> >> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script> >> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" type="text/javascript"></script> >> <#if layoutSettings.javaScripts?has_content> >> <#--layoutSettings.javaScripts is a list of java scripts. --> >> <#-- use a Set to make sure each javascript is declared only once, but iterate the list to maintain the correct order --> >> >> Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original) >> +++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 >> @@ -118,7 +118,8 @@ >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapMarkers.js" global="true"/> >> <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" default-value="main" global="true"/> >> <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" default-value="BIZZNESS_TIME" global="true"/> >> @@ -289,7 +290,8 @@ >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapSimple.js" global="true"/> >> <!-- The default (global) shortcut icon --> >> <set field="layoutSettings.shortcutIcon" value="/images/ofbiz.ico" global="true"/> >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,464 @@ >> +// CalendarDateSelect version 1.15 - a prototype based date picker >> +// Questions, comments, bugs? - see the project page: http://code.google.com/p/calendardateselect >> +if (typeof Prototype == 'undefined') alert("CalendarDateSelect Error: Prototype could not be found. Please make sure that your application's layout includes prototype.js (.g. <%= javascript_include_tag :defaults %>) *before* it includes calendar_date_select.js (.g. <%= calendar_date_select_includes %>)."); >> +if (Prototype.Version < "1.6") alert("Prototype 1.6.0 is required. If using earlier version of prototype, please use calendar_date_select version 1.8.3"); >> + >> +Element.addMethods({ >> + purgeChildren: function(element) { $A(element.childNodes).each(function(e){$(e).remove();}); }, >> + build: function(element, type, options, style) { >> + var newElement = Element.buildAndAppend(type, options, style); >> + element.appendChild(newElement); >> + return newElement; >> + } >> +}); >> + >> +Element.buildAndAppend = function(type, options, style) >> +{ >> + var e = $(document.createElement(type)); >> + $H(options).each(function(pair) { e[pair.key] = pair.value }); >> + if (style) e.setStyle(style); >> + return e; >> +}; >> +nil = null; >> + >> +Date.one_day = 24*60*60*1000; >> +Date.weekdays = $w("S M T W T F S"); >> +Date.first_day_of_week = 0; >> +Date.months = $w("January February March April May June July August September October November December" ); >> +Date.padded2 = function(hour) { var padded2 = parseInt(hour, 10); if (hour < 10) padded2 = "0" + padded2; return padded2; } >> +Date.prototype.getPaddedMinutes = function() { return Date.padded2(this.getMinutes()); } >> +Date.prototype.getAMPMHour = function() { var hour = this.getHours(); return (hour == 0) ? 12 : (hour > 12 ? hour - 12 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "AM" : "PM"; } >> +Date.prototype.stripTime = function() { return new Date(this.getFullYear(), this.getMonth(), this.getDate());}; >> +Date.prototype.daysDistance = function(compare_date) { return Math.round((compare_date - this) / Date.one_day); }; >> +Date.prototype.toFormattedString = function(include_time){ >> + var hour, str; >> + str = Date.months[this.getMonth()] + " " + this.getDate() + ", " + this.getFullYear(); >> + >> + if (include_time) { hour = this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() } >> + return str; >> +} >> +/* mod for OFBiz Date Field */ >> + Date.prototype.toFormattedString_ofbiz_default = function(include_time){ >> + var hour, str; >> + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); >> + >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + ":" + this.getSeconds() + "." + this.getMilliseconds() } >> + return str; >> +} >> +/* mod end*/ >> +Date.parseFormattedString = function(string) { return new Date(string);} >> +Math.floor_to_interval = function(n, i) { return Math.floor(n/i) * i;} >> +window.f_height = function() { return( [window.innerHeight ? window.innerHeight : null, document.documentElement ? document.documentElement.clientHeight : null, document.body ? document.body.clientHeight : null].select(function(x){return x>0}).first()||0); } >> +window.f_scrollTop = function() { return ([window.pageYOffset ? window.pageYOffset : null, document.documentElement ? document.documentElement.scrollTop : null, document.body ? document.body.scrollTop : null].select(function(x){return x>0}).first()||0 ); } >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Now", >> + "Today": "Today", >> + "Clear": "Clear" >> +} >> +SelectBox = Class.create(); >> +SelectBox.prototype = { >> + initialize: function(parent_element, values, html_options, style_options) { >> + this.element = $(parent_element).build("select", html_options, style_options); >> + this.populate(values); >> + }, >> + populate: function(values) { >> + this.element.purgeChildren(); >> + var that = this; $A(values).each(function(pair) { if (typeof(pair)!="object") {pair = [pair, pair]}; that.element.build("option", { value: pair[1], innerHTML: pair[0]}) }); >> + }, >> + setValue: function(value) { >> + var e = this.element; >> + var matched = false; >> + $R(0, e.options.length - 1 ).each(function(i) { if(e.options[i].value==value.toString()) {e.selectedIndex = i; matched = true;}; } ); >> + return matched; >> + }, >> + getValue: function() { return $F(this.element)} >> +} >> +CalendarDateSelect = Class.create(); >> +CalendarDateSelect.prototype = { >> + initialize: function(target_element, options) { >> + this.target_element = $(target_element); // make sure it's an element, not a string >> + if (!this.target_element) { alert("Target element " + target_element + " not found!"); return false;} >> + if (this.target_element.tagName != "INPUT") this.target_element = this.target_element.down("INPUT") >> + >> + this.target_element.calendar_date_select = this; >> + this.last_click_at = 0; >> + // initialize the date control >> + this.options = $H({ >> + embedded: false, >> + popup: nil, >> + time: false, >> + buttons: true, >> + clear_button: true, >> + year_range: 10, >> + close_on_click: nil, >> + minute_interval: 5, >> + popup_by: this.target_element, >> + month_year: "dropdowns", >> + onchange: this.target_element.onchange, >> + valid_date_check: nil >> + }).merge(options || {}); >> + this.use_time = this.options.get("time"); >> + this.parseDate(); >> + this.callback("before_show") >> + this.initCalendarDiv(); >> + if(!this.options.get("embedded")) { >> + this.positionCalendarDiv() >> + // set the click handler to check if a user has clicked away from the document >> + Event.observe(document, "mousedown", this.closeIfClickedOut_handler = this.closeIfClickedOut.bindAsEventListener(this)); >> + Event.observe(document, "keypress", this.keyPress_handler = this.keyPress.bindAsEventListener(this)); >> + } >> + this.callback("after_show") >> + }, >> + positionCalendarDiv: function() { >> + var above = false; >> + var c_pos = this.calendar_div.cumulativeOffset(), c_left = c_pos[0], c_top = c_pos[1], c_dim = this.calendar_div.getDimensions(), c_height = c_dim.height, c_width = c_dim.width; >> + var w_top = window.f_scrollTop(), w_height = window.f_height(); >> + var e_dim = $(this.options.get("popup_by")).cumulativeOffset(), e_top = e_dim[1], e_left = e_dim[0], e_height = $(this.options.get("popup_by")).getDimensions().height, e_bottom = e_top + e_height; >> + >> + if ( (( e_bottom + c_height ) > (w_top + w_height)) && ( e_bottom - c_height > w_top )) above = true; >> + var left_px = e_left.toString() + "px", top_px = (above ? (e_top - c_height ) : ( e_top + e_height )).toString() + "px"; >> + >> + this.calendar_div.style.left = left_px; this.calendar_div.style.top = top_px; >> + >> + this.calendar_div.setStyle({visibility:""}); >> + >> + // draw an iframe behind the calendar -- ugly hack to make IE 6 happy >> + if(navigator.appName=="Microsoft Internet Explorer") this.iframe = $(document.body).build("iframe", {src: "javascript:false", className: "ie6_blocker"}, { left: left_px, top: top_px, height: c_height.toString()+"px", width: c_width.toString()+"px", border: "0px"}) >> + }, >> + initCalendarDiv: function() { >> + if (this.options.get("embedded")) { >> + var parent = this.target_element.parentNode; >> + var style = {} >> + } else { >> + var parent = document.body >> + var style = { position:"absolute", visibility: "hidden", left:0, top:0 } >> + } >> + this.calendar_div = $(parent).build('div', {className: "calendar_date_select"}, style); >> + >> + var that = this; >> + // create the divs >> + $w("top header body buttons footer bottom").each(function(name) { >> + eval("var " + name + "_div = that." + name + "_div = that.calendar_div.build('div', { className: 'cds_"+name+"' }, { clear: 'left'} ); "); >> + }); >> + >> + this.initHeaderDiv(); >> + this.initButtonsDiv(); >> + this.initCalendarGrid(); >> + this.updateFooter(" "); >> + >> + this.refresh(); >> + this.setUseTime(this.use_time); >> + }, >> + initHeaderDiv: function() { >> + var header_div = this.header_div; >> + this.close_button = header_div.build("a", { innerHTML: "x", href:"#", onclick:function () { this.close(); return false; }.bindAsEventListener(this), className: "close" }); >> + this.next_month_button = header_div.build("a", { innerHTML: ">", href:"#", onclick:function () { this.navMonth(this.date.getMonth() + 1 ); return false; }.bindAsEventListener(this), className: "next" }); >> + this.prev_month_button = header_div.build("a", { innerHTML: "<", href:"#", onclick:function () { this.navMonth(this.date.getMonth() - 1 ); return false; }.bindAsEventListener(this), className: "prev" }); >> + >> + if (this.options.get("month_year")=="dropdowns") { >> + this.month_select = new SelectBox(header_div, $R(0,11).map(function(m){return [Date.months[m], m]}), {className: "month", onchange: function () { this.navMonth(this.month_select.getValue()) }.bindAsEventListener(this)}); >> + this.year_select = new SelectBox(header_div, [], {className: "year", onchange: function () { this.navYear(this.year_select.getValue()) }.bindAsEventListener(this)}); >> + this.populateYearRange(); >> + } else { >> + this.month_year_label = header_div.build("span") >> + } >> + }, >> + initCalendarGrid: function() { >> + var body_div = this.body_div; >> + this.calendar_day_grid = []; >> + var days_table = body_div.build("table", { cellPadding: "0px", cellSpacing: "0px", width: "100%" }) >> + // make the weekdays! >> + var weekdays_row = days_table.build("thead").build("tr"); >> + Date.weekdays.each( function(weekday) { >> + weekdays_row.build("th", {innerHTML: weekday}); >> + }); >> + >> + var days_tbody = days_table.build("tbody") >> + // Make the days! >> + var row_number = 0, weekday; >> + for(var cell_index = 0; cell_index<42; cell_index++) >> + { >> + weekday = (cell_index+Date.first_day_of_week ) % 7; >> + if ( cell_index % 7==0 ) days_row = days_tbody.build("tr", {className: 'row_'+row_number++}); >> + (this.calendar_day_grid[cell_index] = days_row.build("td", { >> + calendar_date_select: this, >> + onmouseover: function () { this.calendar_date_select.dayHover(this); }, >> + onmouseout: function () { this.calendar_date_select.dayHoverOut(this) }, >> + onclick: function() { this.calendar_date_select.updateSelectedDate(this, true); }, >> + className: (weekday==0) || (weekday==6) ? " weekend" : "" //clear the class >> + }, >> + { cursor: "pointer" } >> + )).build("div"); >> + this.calendar_day_grid[cell_index]; >> + } >> + }, >> + initButtonsDiv: function() >> + { >> + var buttons_div = this.buttons_div; >> + if (this.options.get("time")) >> + { >> + var blank_time = $A(this.options.get("time")=="mixed" ? [[" - ", ""]] : []); >> + buttons_div.build("span", {innerHTML:"@", className: "at_sign"}); >> + >> + var t = new Date(); >> + this.hour_select = new SelectBox(buttons_div, >> + blank_time.concat($R(0,23).map(function(x) {t.setHours(x); return $A([t.getAMPMHour()+ " " + t.getAMPM(),x])} )), >> + { >> + calendar_date_select: this, >> + onchange: function() { this.calendar_date_select.updateSelectedDate( { hour: this.value });}, >> + className: "hour" >> + } >> + ); >> + buttons_div.build("span", {innerHTML:":", className: "seperator"}); >> + var that = this; >> + this.minute_select = new SelectBox(buttons_div, >> + blank_time.concat($R(0,59).select(function(x){return (x % that.options.get('minute_interval')==0)}).map(function(x){ return $A([ Date.padded2(x), x]); } ) ), >> + { >> + calendar_date_select: this, >> + onchange: function() { this.calendar_date_select.updateSelectedDate( {minute: this.value }) }, >> + className: "minute" >> + } >> + ); >> + >> + } else if (! this.options.get("buttons")) buttons_div.remove(); >> + >> + if (this.options.get("buttons")) { >> + buttons_div.build("span", {innerHTML: " "}); >> + if (this.options.get("time")=="mixed" || !this.options.get("time")) b = buttons_div.build("a", { >> + innerHTML: _translations["Today"], >> + href: "#", >> + onclick: function() {this.today(false); return false;}.bindAsEventListener(this) >> + }); >> + >> + if (this.options.get("time")=="mixed") buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >> + >> + if (this.options.get("time")) b = buttons_div.build("a", { >> + innerHTML: _translations["Now"], >> + href: "#", >> + onclick: function() {this.today(true); return false}.bindAsEventListener(this) >> + }); >> + >> + if (!this.options.get("embedded") && !this.closeOnClick()) >> + { >> + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >> + buttons_div.build("a", { innerHTML: _translations["OK"], href: "#", onclick: function() {this.close(); return false;}.bindAsEventListener(this) }); >> + } >> + if (this.options.get('clear_button')) { >> + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >> + buttons_div.build("a", { innerHTML: _translations["Clear"], href: "#", onclick: function() {this.clearDate(); if (!this.options.get("embedded")) this.close(); return false;}.bindAsEventListener(this) }); >> + } >> + } >> + }, >> + refresh: function () >> + { >> + this.refreshMonthYear(); >> + this.refreshCalendarGrid(); >> + >> + this.setSelectedClass(); >> + this.updateFooter(); >> + }, >> + refreshCalendarGrid: function () { >> + this.beginning_date = new Date(this.date).stripTime(); >> + this.beginning_date.setDate(1); >> + this.beginning_date.setHours(12); // Prevent daylight savings time boundaries from showing a duplicate day >> + var pre_days = this.beginning_date.getDay() // draw some days before the fact >> + if (pre_days < 3) pre_days += 7; >> + this.beginning_date.setDate(1 - pre_days + Date.first_day_of_week); >> + >> + var iterator = new Date(this.beginning_date); >> + >> + var today = new Date().stripTime(); >> + var this_month = this.date.getMonth(); >> + vdc = this.options.get("valid_date_check"); >> + for (var cell_index = 0;cell_index<42; cell_index++) >> + { >> + day = iterator.getDate(); month = iterator.getMonth(); >> + cell = this.calendar_day_grid[cell_index]; >> + Element.remove(cell.childNodes[0]); div = cell.build("div", {innerHTML:day}); >> + if (month!=this_month) div.className = "other"; >> + cell.day = day; cell.month = month; cell.year = iterator.getFullYear(); >> + if (vdc) { if (vdc(iterator.stripTime())) cell.removeClassName("disabled"); else cell.addClassName("disabled") }; >> + iterator.setDate( day + 1); >> + } >> + >> + if (this.today_cell) this.today_cell.removeClassName("today"); >> + >> + if ( $R( 0, 41 ).include(days_until = this.beginning_date.stripTime().daysDistance(today)) ) { >> + this.today_cell = this.calendar_day_grid[days_until]; >> + this.today_cell.addClassName("today"); >> + } >> + }, >> + refreshMonthYear: function() { >> + var m = this.date.getMonth(); >> + var y = this.date.getFullYear(); >> + // set the month >> + if (this.options.get("month_year") == "dropdowns") >> + { >> + this.month_select.setValue(m, false); >> + >> + var e = this.year_select.element; >> + if (this.flexibleYearRange() && (!(this.year_select.setValue(y, false)) || e.selectedIndex <= 1 || e.selectedIndex >= e.options.length - 2 )) this.populateYearRange(); >> + >> + this.year_select.setValue(y); >> + >> + } else { >> + this.month_year_label.update( Date.months[m] + " " + y.toString() ); >> + } >> + }, >> + populateYearRange: function() { >> + this.year_select.populate(this.yearRange().toArray()); >> + }, >> + yearRange: function() { >> + if (!this.flexibleYearRange()) >> + return $R(this.options.get("year_range")[0], this.options.get("year_range")[1]); >> + >> + var y = this.date.getFullYear(); >> + return $R(y - this.options.get("year_range"), y + this.options.get("year_range")); >> + }, >> + flexibleYearRange: function() { return (typeof(this.options.get("year_range")) == "number"); }, >> + validYear: function(year) { if (this.flexibleYearRange()) { return true;} else { return this.yearRange().include(year);} }, >> + dayHover: function(element) { >> + var hover_date = new Date(this.selected_date); >> + hover_date.setYear(element.year); hover_date.setMonth(element.month); hover_date.setDate(element.day); >> + this.updateFooter(hover_date.toFormattedString(this.use_time)); >> + }, >> + dayHoverOut: function(element) { this.updateFooter(); }, >> + clearSelectedClass: function() {if (this.selected_cell) this.selected_cell.removeClassName("selected");}, >> + setSelectedClass: function() { >> + if (!this.selection_made) return; >> + this.clearSelectedClass() >> + if ($R(0,42).include( days_until = this.beginning_date.stripTime().daysDistance(this.selected_date.stripTime()) )) { >> + this.selected_cell = this.calendar_day_grid[days_until]; >> + this.selected_cell.addClassName("selected"); >> + } >> + }, >> + reparse: function() { this.parseDate(); this.refresh(); }, >> + dateString: function() { >> + //mod for ofbiz Date input field, the return value will not be localized. >> + //return (this.selection_made) ? this.selected_date.toFormattedString(this.use_time) : " "; >> + return (this.selection_made) ? this.selected_date.toFormattedString_ofbiz_default(this.use_time) : " "; >> + }, >> + parseDate: function() >> + { >> + var value = $F(this.target_element).strip() >> + this.selection_made = (value != ""); >> + this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value); >> + if (isNaN(this.date)) this.date = new Date(); >> + if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? this.yearRange().start : this.yearRange().end); >> + this.selected_date = new Date(this.date); >> + this.use_time = /[0-9]:[0-9]{2}/.exec(value) ? true : false; >> + this.date.setDate(1); >> + }, >> + updateFooter:function(text) { if (!text) text = this.dateString(); this.footer_div.purgeChildren(); this.footer_div.build("span", {innerHTML: text }); }, >> + clearDate:function() { >> + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; >> + var last_value = this.target_element.value; >> + this.target_element.value = ""; >> + this.clearSelectedClass(); >> + this.updateFooter(' '); >> + if (last_value!=this.target_element.value) this.callback("onchange"); >> + }, >> + updateSelectedDate:function(partsOrElement, via_click) { >> + var parts = $H(partsOrElement); >> + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; >> + if (parts.get("day")) { >> + var t_selected_date = this.selected_date, vdc = this.options.get("valid_date_check"); >> + for (var x = 0; x<=3; x++) t_selected_date.setDate(parts.get("day")); >> + t_selected_date.setYear(parts.get("year")); >> + t_selected_date.setMonth(parts.get("month")); >> + >> + if (vdc && ! vdc(t_selected_date.stripTime())) { return false; } >> + this.selected_date = t_selected_date; >> + this.selection_made = true; >> + } >> + >> + if (!isNaN(parts.get("hour"))) this.selected_date.setHours(parts.get("hour")); >> + if (!isNaN(parts.get("minute"))) this.selected_date.setMinutes( Math.floor_to_interval(parts.get("minute"), this.options.get("minute_interval")) ); >> + if (parts.get("hour") === "" || parts.get("minute") === "") >> + this.setUseTime(false); >> + else if (!isNaN(parts.get("hour")) || !isNaN(parts.get("minute"))) >> + this.setUseTime(true); >> + >> + this.updateFooter(); >> + this.setSelectedClass(); >> + >> + if (this.selection_made) this.updateValue(); >> + if (this.closeOnClick()) { this.close(); } >> + if (via_click && !this.options.get("embedded")) { >> + if ((new Date() - this.last_click_at) < 333) this.close(); >> + this.last_click_at = new Date(); >> + } >> + }, >> + closeOnClick: function() { >> + if (this.options.get("embedded")) return false; >> + if (this.options.get("close_on_click")===nil ) >> + return (this.options.get("time")) ? false : true >> + else >> + return (this.options.get("close_on_click")) >> + }, >> + navMonth: function(month) { (target_date = new Date(this.date)).setMonth(month); return (this.navTo(target_date)); }, >> + navYear: function(year) { (target_date = new Date(this.date)).setYear(year); return (this.navTo(target_date)); }, >> + navTo: function(date) { >> + if (!this.validYear(date.getFullYear())) return false; >> + this.date = date; >> + this.date.setDate(1); >> + this.refresh(); >> + this.callback("after_navigate", this.date); >> + return true; >> + }, >> + setUseTime: function(turn_on) { >> + this.use_time = this.options.get("time") && (this.options.get("time")=="mixed" ? turn_on : true) // force use_time to true if time==true && time!="mixed" >> + if (this.use_time && this.selected_date) { // only set hour/minute if a date is already selected >> + var minute = Math.floor_to_interval(this.selected_date.getMinutes(), this.options.get("minute_interval")); >> + var hour = this.selected_date.getHours(); >> + >> + this.hour_select.setValue(hour); >> + this.minute_select.setValue(minute) >> + } else if (this.options.get("time")=="mixed") { >> + this.hour_select.setValue(""); this.minute_select.setValue(""); >> + } >> + }, >> + updateValue: function() { >> + var last_value = this.target_element.value; >> + this.target_element.value = this.dateString(); >> + if (last_value!=this.target_element.value) this.callback("onchange"); >> + }, >> + today: function(now) { >> + var d = new Date(); this.date = new Date(); >> + var o = $H({ day: d.getDate(), month: d.getMonth(), year: d.getFullYear(), hour: d.getHours(), minute: d.getMinutes()}); >> + if ( ! now ) o = o.merge({hour: "", minute:""}); >> + this.updateSelectedDate(o, true); >> + this.refresh(); >> + }, >> + close: function() { >> + if (this.closed) return false; >> + this.callback("before_close"); >> + this.target_element.calendar_date_select = nil; >> + Event.stopObserving(document, "mousedown", this.closeIfClickedOut_handler); >> + Event.stopObserving(document, "keypress", this.keyPress_handler); >> + this.calendar_div.remove(); this.closed = true; >> + if (this.iframe) this.iframe.remove(); >> + if (this.target_element.type != "hidden" && ! this.target_element.disabled) this.target_element.focus(); >> + this.callback("after_close"); >> + }, >> + closeIfClickedOut: function(e) { >> + if (! $(Event.element(e)).descendantOf(this.calendar_div) ) this.close(); >> + }, >> + keyPress: function(e) { >> + if (e.keyCode==Event.KEY_ESC) this.close(); >> + }, >> + callback: function(name, param) { if (this.options.get(name)) { this.options.get(name).bind(this.target_element)(param); } } >> +} >> + >> + >> +//OFBiz addition: functions to call the calendar >> +function call_cal(target, datetime) { >> + new CalendarDateSelect(target, {time:true,year_range:10} ); >> +} >> + >> +function call_cal_notime(target, datetime) { >> + new CalendarDateSelect(target, {time:false,year_range:10} ); >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,34 @@ >> +// American Format: 12/31/2000 5:00 pm >> +// Thanks, Wes Hays >> +Date.prototype.toFormattedString = function(include_time){ >> + str = Date.padded2(this.getMonth() + 1) + '/' +Date.padded2(this.getDate()) + '/' + this.getFullYear(); >> + >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() } >> + return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + // Test these with and without the time >> + // 11/11/1111 12pm >> + // 11/11/1111 1pm >> + // 1/11/1111 10:10pm >> + // 11/1/1111 01pm >> + // 1/1/1111 01:11pm >> + // 1/1/1111 1:11pm >> + var regexp = "(([0-1]?[0-9])\/[0-3]?[0-9]\/[0-9]{4}) *([0-9]{1,2}(:[0-9]{2})? *(am|pm))?"; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) { >> + return Date.parse(string); // Give javascript a chance to parse it. >> + } >> + >> + mdy = d[1].split('/'); >> + hrs = 0; >> + mts = 0; >> + if(d[3] != null) { >> + hrs = parseInt(d[3].split('')[0], 10); >> + if(d[5].toLowerCase() == 'pm') { hrs += 12; } // Add 12 more to hrs >> + mts = d[4].split(':')[1]; >> + } >> + >> + return new Date(mdy[2], parseInt(mdy[0], 10)-1, mdy[1], hrs, mts, 0); >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,27 @@ >> +// DB No Seconds Format: 2007-12-05 12:00 >> + >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + var regexp = '([0-9]{4})-(([0-9]{1,2})-(([0-9]{1,2})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + var date = new Date(d[1], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[5]); } >> + if (d[7]) { >> + date.setHours(parseInt(d[7], 10)); >> + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + return date; >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,12 @@ >> +// Time Format as "17:00" in DropDown Box >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +// Formats date and time as "01 January 2000 17:00" >> +Date.prototype.toFormattedString = function(include_time) >> +{ >> + str = Date.padded2(this.getDate()) + " " + Date.months[this.getMonth()] + " " + this.getFullYear(); >> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,12 @@ >> +// Time Format as "17:00" in DropDown Box >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +// Formats date and time as "2000.01.20 17:00" >> +Date.prototype.toFormattedString = function(include_time) >> +{ >> + str = this.getFullYear() + "." + Date.padded2(this.getMonth()+1) + "." + Date.padded2(this.getDate()); >> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,33 @@ >> +// Time Format as "17:00" in DropDown Box >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getDate() + "." + (this.getMonth() + 1) + "." + this.getFullYear(); >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> +Date.parseFormattedString = function (string) { >> + var regexp = '([0-9]{1,2})\.(([0-9]{1,2})\.(([0-9]{2,4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + if (d[5] && d[5].length == 2) { >> + // we got only two digits for the year... >> + d[5] = Number(d[5]); >> + if (d[5] > 30) >> + d[5] += 1900; >> + else >> + d[5] += 2000; >> + } >> + var date = new Date(d[5], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[1]); } >> + if (d[7]) { >> + date.setHours(parseInt(d[7], 10)); >> + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + return date; >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,37 @@ >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); >> + >> +if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() } >> +return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + >> + "( ([0-9]{1,2}):([0-9]{2})? *(pm|am)" + >> + "?)?)?)?"; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + var date = new Date(d[1], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[5]); } >> + if (d[7]) { >> + hours = parseInt(d[7], 10); >> + offset=0; >> + if (d[9]) { >> + is_pm = (d[9].toLowerCase()=="pm"); >> + if (is_pm && hours <= 11) hours+=12; >> + if (!is_pm && hours == 12) hours=0; >> + } >> + date.setHours(hours); >> + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); } >> + if (d[14]) { >> + offset = (Number(d[16]) * 60) + Number(d[17]); >> + offset *= ((d[15] == '-') ? 1 : -1); >> + } >> + >> + return date; >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,46 @@ >> +Date.prototype.toFormattedString = function(include_time) { >> + var hour; >> + var str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); >> + if (include_time) { >> + hour = this.getHours(); >> + str += " " + this.getHours() + ":" + this.getPaddedMinutes(); >> + } >> + return str; >> +}; >> + >> +Date.parseFormattedString = function (string) { >> + >> + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + >> + "( ([0-9]{1,2}):([0-9]{2})?" + >> + "?)?)?)?"; >> + >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d === null) { >> + return Date.parse(string); // at least give javascript a crack at it. >> + } >> + var offset = 0; >> + var date = new Date(d[1], 0, 1); >> + if (d[3]) { >> + date.setMonth(d[3] - 1); >> + } >> + if (d[5]) { >> + date.setDate(d[5]); >> + } >> + if (d[7]) { >> + date.setHours(d[7]); >> + } >> + if (d[8]) { >> + date.setMinutes(d[8]); >> + } >> + if (d[0]) { >> + date.setSeconds(d[0]); >> + } >> + if (d[2]) { >> + date.setMilliseconds(Number("0." + d[2])); >> + } >> + if (d[4]) { >> + offset = (Number(d[6])) + Number(d[8]); >> + offset = ((d[5] == '-') ? 1 : -1); >> + } >> + return date; >> +}; >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,24 @@ >> +// Italian Format: 31/12/2000 23:00 >> +// Thanks, Bigonazzi! >> + >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getDate() + "/" + (this.getMonth() + 1) + "/" + this.getFullYear(); >> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + var regexp = '([0-9]{1,2})/(([0-9]{1,2})/(([0-9]{4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + var date = new Date(d[5], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[1]); } >> + if (d[7]) { >> + date.setHours(parseInt(d[7], 10)); >> + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + return date; >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,19 @@ >> +Date.weekdays = $w('Mo Di Mi Do Fr Sa So'); >> +Date.months = $w('Januar Februar März April Mai Juni Juli August September Oktober November Dezember'); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Jetzt", >> + "Today": "Heute", >> + "Clear": "Löschen" >> +} >> + >> +//load the data format >> +var dataFormatJs = "format_euro_24hr.js" >> + >> +var e = document.createElement("script"); >> +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; >> +e.type="text/javascript"; >> +document.getElementsByTagName("head")[0].appendChild(e); >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,11 @@ >> +Date.weekdays = $w("L M X J V S D"); >> +Date.months = $w("Enero Febrero Marzo Abril Mayo Junio Julio Agosto Septiembre Octubre Noviembre Diciembre" ); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "Cancelar", >> + "Now": "Ahora", >> + "Clear": "Limpiar", >> + "Today": "Hoy" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w("Ma Ti Ke To Pe La Su"); >> +Date.months = $w("Tammikuu Helmikuu Maaliskuu Huhtikuu Toukokuu Kesäkuu Heinäkuu Elokuu Syyskuu Lokakuu Marraskuu Joulukuu" ); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Nyt", >> + "Today": "Tänään" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,19 @@ >> +Date.weekdays = $w('L Ma Me J V S D'); >> +Date.months = $w('Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre'); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Maintenant", >> + "Today": "Aujourd'hui", >> + "Clear": "Effacer" >> +} >> + >> +//load the data format >> +var dataFormatJs = "format_euro_24hr.js" >> + >> +var e = document.createElement("script"); >> +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; >> +e.type="text/javascript"; >> +document.getElementsByTagName("head")[0].appendChild(e); >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,11 @@ >> +Date.weekdays = $w('Ma Di Wo Do Vr Za Zo'); >> +Date.months = $w('Januari Februari Maart April Mei Juni Juli Augustus September Oktober November December'); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Nu", >> + "Today": "Vandaag", >> + "Clear": "Wissen" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w('P W Å C P S N'); >> +Date.months = $w('StyczeÅ Luty Marzec KwiecieÅ Maj Czerwiec Lipiec SierpieÅ WrzesieÅ Październik Listopad GrudzieÅ'); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Teraz", >> + "Today": "DziÅ" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,11 @@ >> +Date.weekdays = $w('D S T Q Q S S'); >> +Date.months = $w('Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro'); >> + >> +Date.first_day_of_week = 0 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Agora", >> + "Today": "Hoje", >> + "Clear": "Limpar" >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w('Ðн ÐÑ Ð¡Ñ Ð§Ñ ÐÑ Ð¡Ð± ÐÑ?'); >> +Date.months = $w('ЯнваÑÑ Ð¤ÐµÐ²ÑÐ°Ð»Ñ ÐаÑÑ Ð?пÑÐµÐ»Ñ Ðай ÐÑÐ½Ñ ÐÑÐ»Ñ Ð?вгÑÑ?Ñ Ð¡ÐµÐ½ÑÑ?бÑÑ ÐкÑÑ?бÑÑ Ð?оÑ?бÑÑ ÐекабÑÑ'); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "СейÑаÑ?", >> + "Today": "СегоднÑ?" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w("? ? ? ? ? ? ?"); >> +Date.months = $w("? ? ? ? ? ? ? ? ? ? ?? ??" ); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "??", >> + "Now": "??", >> + "Today": "??" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Modified: ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl (original) >> +++ ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl Wed Dec 2 13:54:17 2009 >> @@ -26,8 +26,8 @@ >> <script language="javascript" src="/images/prototypejs/prototype.js" type="text/javascript"></script> >> <script language="javascript" src="/images/fieldlookup.js" type="text/javascript"></script> >> <script language="javascript" src="/images/selectall.js" type="text/javascript"></script> >> - <script language="javascript" src="/images/calendar_date_select.js" type="text/javascript"></script> >> - >> + <script language="javascript" src="/images/calendarDateSelect/calendar_date_select.js" type="text/javascript"></script> >> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" type="text/javascript"></script> >> <link rel="stylesheet" href="/images/ecommain.css" type="text/css"/> >> <link rel="stylesheet" href="/ecommerce/images/blog.css" type="text/css"/> >> <link rel="stylesheet" href="/content/images/contentForum.css" type="text/css"/> >> >> Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl (original) >> +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl Wed Dec 2 13:54:17 2009 >> @@ -24,7 +24,8 @@ >> <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/prototype.js</@ofbizContentUrl>" type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" type="text/javascript"></script> >> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script> >> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script> >> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale!}.js</@ofbizContentUrl>" type="text/javascript"></script> >> <link rel='stylesheet' href='<@ofbizContentUrl>/images/maincss.css</@ofbizContentUrl>' type='text/css'> >> <link rel='stylesheet' href='<@ofbizContentUrl>/images/tabstyles.css</@ofbizContentUrl>' type='text/css'> >> <link rel='stylesheet' href='<@ofbizContentUrl>/ecommerce/images/blog.css</@ofbizContentUrl>' type='text/css'> >> >> Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml (original) >> +++ ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 >> @@ -41,7 +41,8 @@ >> <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[+0]" value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >> @@ -222,7 +223,7 @@ >> </widgets> >> </section> >> </screen> >> - >> + >> <screen name="CommonPopUpDecorator"> >> <section> >> <actions> >> @@ -244,7 +245,8 @@ >> <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >> >> >> > |
Administrator
|
Oops, hindi word did not get through here is one प्रयोक्ता लॉगिन क्रमांक
Jacques From: "Jacques Le Roux" <[hidden email]> Actually thanks are for Sascha who did a great and quick job, Sascha is a student. I tried with Hindi (proof : ;o) it works.. Jacques From: "Bilgin Ibryam" <[hidden email]> To: <[hidden email]> Sent: Thursday, December 03, 2009 9:34 AM Subject: Re: svn commit: r886143 - in /ofbiz/trunk: ./ framework/common/webcommon/includes/ framework/common/widget/ framework/images/webapp/images/ framework/images/webapp/images/calendarDateSelect/ framework/images/webapp/images/calendarDateSelect/format/ framewo... > Hi Jacques, > > thanks for the nice localization. > I was wondering should we also add the js files in format and locale > folders also to LICENSE file? > > Bilgin > > [hidden email] wrote: >> Author: jleroux >> Date: Wed Dec 2 13:54:17 2009 >> New Revision: 886143 >> >> URL: http://svn.apache.org/viewvc?rev=886143&view=rev >> Log: >> A patch from Sascha Rodekamp " Colors and localisation for the calendar" (https://issues.apache.org/jira/browse/OFBIZ-1825) - >> OFBIZ-1825 >> Simple and clear implementation! >> >> Added: >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/ >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/ >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (with props) >> Removed: >> ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js >> Modified: >> ofbiz/trunk/LICENSE >> ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl >> ofbiz/trunk/framework/common/widget/CommonScreens.xml >> ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl >> ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl >> ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml >> >> Modified: ofbiz/trunk/LICENSE >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/LICENSE (original) >> +++ ofbiz/trunk/LICENSE Wed Dec 2 13:54:17 2009 >> @@ -1227,7 +1227,7 @@ >> ofbiz/trunk/framework/jetty/lib/slf4j-api-1.3.1.jar >> ofbiz/trunk/framework/jetty/lib/slf4j-log4j12-1.3.1.jar >> ofbiz/trunk/framework/images/webapp/images/htmledit/whizzywig_v55i.js >> -ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js >> +ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ========================================================================= >> The MIT License >> >> >> Modified: ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl (original) >> +++ ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl Wed Dec 2 13:54:17 2009 >> @@ -30,7 +30,8 @@ >> <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/scriptaculous.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> + <script language="javascript" >> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <#if layoutSettings.javaScripts?has_content> >> <#--layoutSettings.javaScripts is a list of java scripts. --> >> <#-- use a Set to make sure each javascript is declared only once, but iterate the list to maintain the correct >> order --> >> >> Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original) >> +++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 >> @@ -118,7 +118,8 @@ >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >> global="true"/> >> + <set field="layoutSettings.javaScripts[]" >> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapMarkers.js" global="true"/> >> <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" >> default-value="main" global="true"/> >> <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" default-value="BIZZNESS_TIME" >> global="true"/> >> @@ -289,7 +290,8 @@ >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >> global="true"/> >> + <set field="layoutSettings.javaScripts[]" >> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapSimple.js" global="true"/> >> <!-- The default (global) shortcut icon --> >> <set field="layoutSettings.shortcutIcon" value="/images/ofbiz.ico" global="true"/> >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,464 @@ >> +// CalendarDateSelect version 1.15 - a prototype based date picker >> +// Questions, comments, bugs? - see the project page: http://code.google.com/p/calendardateselect >> +if (typeof Prototype == 'undefined') alert("CalendarDateSelect Error: Prototype could not be found. Please make sure that your >> application's layout includes prototype.js (.g. <%= javascript_include_tag :defaults %>) *before* it includes >> calendar_date_select.js (.g. <%= calendar_date_select_includes %>)."); >> +if (Prototype.Version < "1.6") alert("Prototype 1.6.0 is required. If using earlier version of prototype, please use >> calendar_date_select version 1.8.3"); >> + >> +Element.addMethods({ >> + purgeChildren: function(element) { $A(element.childNodes).each(function(e){$(e).remove();}); }, >> + build: function(element, type, options, style) { >> + var newElement = Element.buildAndAppend(type, options, style); >> + element.appendChild(newElement); >> + return newElement; >> + } >> +}); >> + >> +Element.buildAndAppend = function(type, options, style) >> +{ >> + var e = $(document.createElement(type)); >> + $H(options).each(function(pair) { e[pair.key] = pair.value }); >> + if (style) e.setStyle(style); >> + return e; >> +}; >> +nil = null; >> + >> +Date.one_day = 24*60*60*1000; >> +Date.weekdays = $w("S M T W T F S"); >> +Date.first_day_of_week = 0; >> +Date.months = $w("January February March April May June July August September October November December" ); >> +Date.padded2 = function(hour) { var padded2 = parseInt(hour, 10); if (hour < 10) padded2 = "0" + padded2; return padded2; } >> +Date.prototype.getPaddedMinutes = function() { return Date.padded2(this.getMinutes()); } >> +Date.prototype.getAMPMHour = function() { var hour = this.getHours(); return (hour == 0) ? 12 : (hour > 12 ? hour - 12 : >> hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "AM" : "PM"; } >> +Date.prototype.stripTime = function() { return new Date(this.getFullYear(), this.getMonth(), this.getDate());}; >> +Date.prototype.daysDistance = function(compare_date) { return Math.round((compare_date - this) / Date.one_day); }; >> +Date.prototype.toFormattedString = function(include_time){ >> + var hour, str; >> + str = Date.months[this.getMonth()] + " " + this.getDate() + ", " + this.getFullYear(); >> + >> + if (include_time) { hour = this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >> this.getAMPM() } >> + return str; >> +} >> +/* mod for OFBiz Date Field */ >> + Date.prototype.toFormattedString_ofbiz_default = function(include_time){ >> + var hour, str; >> + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); >> + >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + ":" + >> this.getSeconds() + "." + this.getMilliseconds() } >> + return str; >> +} >> +/* mod end*/ >> +Date.parseFormattedString = function(string) { return new Date(string);} >> +Math.floor_to_interval = function(n, i) { return Math.floor(n/i) * i;} >> +window.f_height = function() { return( [window.innerHeight ? window.innerHeight : null, document.documentElement ? >> document.documentElement.clientHeight : null, document.body ? document.body.clientHeight : null].select(function(x){return >> x>0}).first()||0); } >> +window.f_scrollTop = function() { return ([window.pageYOffset ? window.pageYOffset : null, document.documentElement ? >> document.documentElement.scrollTop : null, document.body ? document.body.scrollTop : null].select(function(x){return >> x>0}).first()||0 ); } >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Now", >> + "Today": "Today", >> + "Clear": "Clear" >> +} >> +SelectBox = Class.create(); >> +SelectBox.prototype = { >> + initialize: function(parent_element, values, html_options, style_options) { >> + this.element = $(parent_element).build("select", html_options, style_options); >> + this.populate(values); >> + }, >> + populate: function(values) { >> + this.element.purgeChildren(); >> + var that = this; $A(values).each(function(pair) { if (typeof(pair)!="object") {pair = [pair, pair]}; >> that.element.build("option", { value: pair[1], innerHTML: pair[0]}) }); >> + }, >> + setValue: function(value) { >> + var e = this.element; >> + var matched = false; >> + $R(0, e.options.length - 1 ).each(function(i) { if(e.options[i].value==value.toString()) {e.selectedIndex = i; matched = >> true;}; } ); >> + return matched; >> + }, >> + getValue: function() { return $F(this.element)} >> +} >> +CalendarDateSelect = Class.create(); >> +CalendarDateSelect.prototype = { >> + initialize: function(target_element, options) { >> + this.target_element = $(target_element); // make sure it's an element, not a string >> + if (!this.target_element) { alert("Target element " + target_element + " not found!"); return false;} >> + if (this.target_element.tagName != "INPUT") this.target_element = this.target_element.down("INPUT") >> + >> + this.target_element.calendar_date_select = this; >> + this.last_click_at = 0; >> + // initialize the date control >> + this.options = $H({ >> + embedded: false, >> + popup: nil, >> + time: false, >> + buttons: true, >> + clear_button: true, >> + year_range: 10, >> + close_on_click: nil, >> + minute_interval: 5, >> + popup_by: this.target_element, >> + month_year: "dropdowns", >> + onchange: this.target_element.onchange, >> + valid_date_check: nil >> + }).merge(options || {}); >> + this.use_time = this.options.get("time"); >> + this.parseDate(); >> + this.callback("before_show") >> + this.initCalendarDiv(); >> + if(!this.options.get("embedded")) { >> + this.positionCalendarDiv() >> + // set the click handler to check if a user has clicked away from the document >> + Event.observe(document, "mousedown", this.closeIfClickedOut_handler = this.closeIfClickedOut.bindAsEventListener(this)); >> + Event.observe(document, "keypress", this.keyPress_handler = this.keyPress.bindAsEventListener(this)); >> + } >> + this.callback("after_show") >> + }, >> + positionCalendarDiv: function() { >> + var above = false; >> + var c_pos = this.calendar_div.cumulativeOffset(), c_left = c_pos[0], c_top = c_pos[1], c_dim = >> this.calendar_div.getDimensions(), c_height = c_dim.height, c_width = c_dim.width; >> + var w_top = window.f_scrollTop(), w_height = window.f_height(); >> + var e_dim = $(this.options.get("popup_by")).cumulativeOffset(), e_top = e_dim[1], e_left = e_dim[0], e_height = >> $(this.options.get("popup_by")).getDimensions().height, e_bottom = e_top + e_height; >> + >> + if ( (( e_bottom + c_height ) > (w_top + w_height)) && ( e_bottom - c_height > w_top )) above = true; >> + var left_px = e_left.toString() + "px", top_px = (above ? (e_top - c_height ) : ( e_top + e_height )).toString() + "px"; >> + >> + this.calendar_div.style.left = left_px; this.calendar_div.style.top = top_px; >> + >> + this.calendar_div.setStyle({visibility:""}); >> + >> + // draw an iframe behind the calendar -- ugly hack to make IE 6 happy >> + if(navigator.appName=="Microsoft Internet Explorer") this.iframe = $(document.body).build("iframe", {src: >> "javascript:false", className: "ie6_blocker"}, { left: left_px, top: top_px, height: c_height.toString()+"px", width: >> c_width.toString()+"px", border: "0px"}) >> + }, >> + initCalendarDiv: function() { >> + if (this.options.get("embedded")) { >> + var parent = this.target_element.parentNode; >> + var style = {} >> + } else { >> + var parent = document.body >> + var style = { position:"absolute", visibility: "hidden", left:0, top:0 } >> + } >> + this.calendar_div = $(parent).build('div', {className: "calendar_date_select"}, style); >> + >> + var that = this; >> + // create the divs >> + $w("top header body buttons footer bottom").each(function(name) { >> + eval("var " + name + "_div = that." + name + "_div = that.calendar_div.build('div', { className: 'cds_"+name+"' }, { >> clear: 'left'} ); "); >> + }); >> + >> + this.initHeaderDiv(); >> + this.initButtonsDiv(); >> + this.initCalendarGrid(); >> + this.updateFooter(" "); >> + >> + this.refresh(); >> + this.setUseTime(this.use_time); >> + }, >> + initHeaderDiv: function() { >> + var header_div = this.header_div; >> + this.close_button = header_div.build("a", { innerHTML: "x", href:"#", onclick:function () { this.close(); return >> false; }.bindAsEventListener(this), className: "close" }); >> + this.next_month_button = header_div.build("a", { innerHTML: ">", href:"#", onclick:function () { >> this.navMonth(this.date.getMonth() + 1 ); return false; }.bindAsEventListener(this), className: "next" }); >> + this.prev_month_button = header_div.build("a", { innerHTML: "<", href:"#", onclick:function () { >> this.navMonth(this.date.getMonth() - 1 ); return false; }.bindAsEventListener(this), className: "prev" }); >> + >> + if (this.options.get("month_year")=="dropdowns") { >> + this.month_select = new SelectBox(header_div, $R(0,11).map(function(m){return [Date.months[m], m]}), {className: "month", >> onchange: function () { this.navMonth(this.month_select.getValue()) }.bindAsEventListener(this)}); >> + this.year_select = new SelectBox(header_div, [], {className: "year", onchange: function () { >> this.navYear(this.year_select.getValue()) }.bindAsEventListener(this)}); >> + this.populateYearRange(); >> + } else { >> + this.month_year_label = header_div.build("span") >> + } >> + }, >> + initCalendarGrid: function() { >> + var body_div = this.body_div; >> + this.calendar_day_grid = []; >> + var days_table = body_div.build("table", { cellPadding: "0px", cellSpacing: "0px", width: "100%" }) >> + // make the weekdays! >> + var weekdays_row = days_table.build("thead").build("tr"); >> + Date.weekdays.each( function(weekday) { >> + weekdays_row.build("th", {innerHTML: weekday}); >> + }); >> + >> + var days_tbody = days_table.build("tbody") >> + // Make the days! >> + var row_number = 0, weekday; >> + for(var cell_index = 0; cell_index<42; cell_index++) >> + { >> + weekday = (cell_index+Date.first_day_of_week ) % 7; >> + if ( cell_index % 7==0 ) days_row = days_tbody.build("tr", {className: 'row_'+row_number++}); >> + (this.calendar_day_grid[cell_index] = days_row.build("td", { >> + calendar_date_select: this, >> + onmouseover: function () { this.calendar_date_select.dayHover(this); }, >> + onmouseout: function () { this.calendar_date_select.dayHoverOut(this) }, >> + onclick: function() { this.calendar_date_select.updateSelectedDate(this, true); }, >> + className: (weekday==0) || (weekday==6) ? " weekend" : "" //clear the class >> + }, >> + { cursor: "pointer" } >> + )).build("div"); >> + this.calendar_day_grid[cell_index]; >> + } >> + }, >> + initButtonsDiv: function() >> + { >> + var buttons_div = this.buttons_div; >> + if (this.options.get("time")) >> + { >> + var blank_time = $A(this.options.get("time")=="mixed" ? [[" - ", ""]] : []); >> + buttons_div.build("span", {innerHTML:"@", className: "at_sign"}); >> + >> + var t = new Date(); >> + this.hour_select = new SelectBox(buttons_div, >> + blank_time.concat($R(0,23).map(function(x) {t.setHours(x); return $A([t.getAMPMHour()+ " " + t.getAMPM(),x])} )), >> + { >> + calendar_date_select: this, >> + onchange: function() { this.calendar_date_select.updateSelectedDate( { hour: this.value });}, >> + className: "hour" >> + } >> + ); >> + buttons_div.build("span", {innerHTML:":", className: "seperator"}); >> + var that = this; >> + this.minute_select = new SelectBox(buttons_div, >> + blank_time.concat($R(0,59).select(function(x){return (x % that.options.get('minute_interval')==0)}).map(function(x){ >> return $A([ Date.padded2(x), x]); } ) ), >> + { >> + calendar_date_select: this, >> + onchange: function() { this.calendar_date_select.updateSelectedDate( {minute: this.value }) }, >> + className: "minute" >> + } >> + ); >> + >> + } else if (! this.options.get("buttons")) buttons_div.remove(); >> + >> + if (this.options.get("buttons")) { >> + buttons_div.build("span", {innerHTML: " "}); >> + if (this.options.get("time")=="mixed" || !this.options.get("time")) b = buttons_div.build("a", { >> + innerHTML: _translations["Today"], >> + href: "#", >> + onclick: function() {this.today(false); return false;}.bindAsEventListener(this) >> + }); >> + >> + if (this.options.get("time")=="mixed") buttons_div.build("span", {innerHTML: " | ", >> className:"button_seperator"}) >> + >> + if (this.options.get("time")) b = buttons_div.build("a", { >> + innerHTML: _translations["Now"], >> + href: "#", >> + onclick: function() {this.today(true); return false}.bindAsEventListener(this) >> + }); >> + >> + if (!this.options.get("embedded") && !this.closeOnClick()) >> + { >> + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >> + buttons_div.build("a", { innerHTML: _translations["OK"], href: "#", onclick: function() {this.close(); return >> false;}.bindAsEventListener(this) }); >> + } >> + if (this.options.get('clear_button')) { >> + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >> + buttons_div.build("a", { innerHTML: _translations["Clear"], href: "#", onclick: function() {this.clearDate(); if >> (!this.options.get("embedded")) this.close(); return false;}.bindAsEventListener(this) }); >> + } >> + } >> + }, >> + refresh: function () >> + { >> + this.refreshMonthYear(); >> + this.refreshCalendarGrid(); >> + >> + this.setSelectedClass(); >> + this.updateFooter(); >> + }, >> + refreshCalendarGrid: function () { >> + this.beginning_date = new Date(this.date).stripTime(); >> + this.beginning_date.setDate(1); >> + this.beginning_date.setHours(12); // Prevent daylight savings time boundaries from showing a duplicate day >> + var pre_days = this.beginning_date.getDay() // draw some days before the fact >> + if (pre_days < 3) pre_days += 7; >> + this.beginning_date.setDate(1 - pre_days + Date.first_day_of_week); >> + >> + var iterator = new Date(this.beginning_date); >> + >> + var today = new Date().stripTime(); >> + var this_month = this.date.getMonth(); >> + vdc = this.options.get("valid_date_check"); >> + for (var cell_index = 0;cell_index<42; cell_index++) >> + { >> + day = iterator.getDate(); month = iterator.getMonth(); >> + cell = this.calendar_day_grid[cell_index]; >> + Element.remove(cell.childNodes[0]); div = cell.build("div", {innerHTML:day}); >> + if (month!=this_month) div.className = "other"; >> + cell.day = day; cell.month = month; cell.year = iterator.getFullYear(); >> + if (vdc) { if (vdc(iterator.stripTime())) cell.removeClassName("disabled"); else cell.addClassName("disabled") }; >> + iterator.setDate( day + 1); >> + } >> + >> + if (this.today_cell) this.today_cell.removeClassName("today"); >> + >> + if ( $R( 0, 41 ).include(days_until = this.beginning_date.stripTime().daysDistance(today)) ) { >> + this.today_cell = this.calendar_day_grid[days_until]; >> + this.today_cell.addClassName("today"); >> + } >> + }, >> + refreshMonthYear: function() { >> + var m = this.date.getMonth(); >> + var y = this.date.getFullYear(); >> + // set the month >> + if (this.options.get("month_year") == "dropdowns") >> + { >> + this.month_select.setValue(m, false); >> + >> + var e = this.year_select.element; >> + if (this.flexibleYearRange() && (!(this.year_select.setValue(y, false)) || e.selectedIndex <= 1 || e.selectedIndex >= >> e.options.length - 2 )) this.populateYearRange(); >> + >> + this.year_select.setValue(y); >> + >> + } else { >> + this.month_year_label.update( Date.months[m] + " " + y.toString() ); >> + } >> + }, >> + populateYearRange: function() { >> + this.year_select.populate(this.yearRange().toArray()); >> + }, >> + yearRange: function() { >> + if (!this.flexibleYearRange()) >> + return $R(this.options.get("year_range")[0], this.options.get("year_range")[1]); >> + >> + var y = this.date.getFullYear(); >> + return $R(y - this.options.get("year_range"), y + this.options.get("year_range")); >> + }, >> + flexibleYearRange: function() { return (typeof(this.options.get("year_range")) == "number"); }, >> + validYear: function(year) { if (this.flexibleYearRange()) { return true;} else { return this.yearRange().include(year);} }, >> + dayHover: function(element) { >> + var hover_date = new Date(this.selected_date); >> + hover_date.setYear(element.year); hover_date.setMonth(element.month); hover_date.setDate(element.day); >> + this.updateFooter(hover_date.toFormattedString(this.use_time)); >> + }, >> + dayHoverOut: function(element) { this.updateFooter(); }, >> + clearSelectedClass: function() {if (this.selected_cell) this.selected_cell.removeClassName("selected");}, >> + setSelectedClass: function() { >> + if (!this.selection_made) return; >> + this.clearSelectedClass() >> + if ($R(0,42).include( days_until = this.beginning_date.stripTime().daysDistance(this.selected_date.stripTime()) )) { >> + this.selected_cell = this.calendar_day_grid[days_until]; >> + this.selected_cell.addClassName("selected"); >> + } >> + }, >> + reparse: function() { this.parseDate(); this.refresh(); }, >> + dateString: function() { >> + //mod for ofbiz Date input field, the return value will not be localized. >> + //return (this.selection_made) ? this.selected_date.toFormattedString(this.use_time) : " "; >> + return (this.selection_made) ? this.selected_date.toFormattedString_ofbiz_default(this.use_time) : " "; >> + }, >> + parseDate: function() >> + { >> + var value = $F(this.target_element).strip() >> + this.selection_made = (value != ""); >> + this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value); >> + if (isNaN(this.date)) this.date = new Date(); >> + if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? >> this.yearRange().start : this.yearRange().end); >> + this.selected_date = new Date(this.date); >> + this.use_time = /[0-9]:[0-9]{2}/.exec(value) ? true : false; >> + this.date.setDate(1); >> + }, >> + updateFooter:function(text) { if (!text) text = this.dateString(); this.footer_div.purgeChildren(); >> this.footer_div.build("span", {innerHTML: text }); }, >> + clearDate:function() { >> + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; >> + var last_value = this.target_element.value; >> + this.target_element.value = ""; >> + this.clearSelectedClass(); >> + this.updateFooter(' '); >> + if (last_value!=this.target_element.value) this.callback("onchange"); >> + }, >> + updateSelectedDate:function(partsOrElement, via_click) { >> + var parts = $H(partsOrElement); >> + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; >> + if (parts.get("day")) { >> + var t_selected_date = this.selected_date, vdc = this.options.get("valid_date_check"); >> + for (var x = 0; x<=3; x++) t_selected_date.setDate(parts.get("day")); >> + t_selected_date.setYear(parts.get("year")); >> + t_selected_date.setMonth(parts.get("month")); >> + >> + if (vdc && ! vdc(t_selected_date.stripTime())) { return false; } >> + this.selected_date = t_selected_date; >> + this.selection_made = true; >> + } >> + >> + if (!isNaN(parts.get("hour"))) this.selected_date.setHours(parts.get("hour")); >> + if (!isNaN(parts.get("minute"))) this.selected_date.setMinutes( Math.floor_to_interval(parts.get("minute"), >> this.options.get("minute_interval")) ); >> + if (parts.get("hour") === "" || parts.get("minute") === "") >> + this.setUseTime(false); >> + else if (!isNaN(parts.get("hour")) || !isNaN(parts.get("minute"))) >> + this.setUseTime(true); >> + >> + this.updateFooter(); >> + this.setSelectedClass(); >> + >> + if (this.selection_made) this.updateValue(); >> + if (this.closeOnClick()) { this.close(); } >> + if (via_click && !this.options.get("embedded")) { >> + if ((new Date() - this.last_click_at) < 333) this.close(); >> + this.last_click_at = new Date(); >> + } >> + }, >> + closeOnClick: function() { >> + if (this.options.get("embedded")) return false; >> + if (this.options.get("close_on_click")===nil ) >> + return (this.options.get("time")) ? false : true >> + else >> + return (this.options.get("close_on_click")) >> + }, >> + navMonth: function(month) { (target_date = new Date(this.date)).setMonth(month); return (this.navTo(target_date)); }, >> + navYear: function(year) { (target_date = new Date(this.date)).setYear(year); return (this.navTo(target_date)); }, >> + navTo: function(date) { >> + if (!this.validYear(date.getFullYear())) return false; >> + this.date = date; >> + this.date.setDate(1); >> + this.refresh(); >> + this.callback("after_navigate", this.date); >> + return true; >> + }, >> + setUseTime: function(turn_on) { >> + this.use_time = this.options.get("time") && (this.options.get("time")=="mixed" ? turn_on : true) // force use_time to true >> if time==true && time!="mixed" >> + if (this.use_time && this.selected_date) { // only set hour/minute if a date is already selected >> + var minute = Math.floor_to_interval(this.selected_date.getMinutes(), this.options.get("minute_interval")); >> + var hour = this.selected_date.getHours(); >> + >> + this.hour_select.setValue(hour); >> + this.minute_select.setValue(minute) >> + } else if (this.options.get("time")=="mixed") { >> + this.hour_select.setValue(""); this.minute_select.setValue(""); >> + } >> + }, >> + updateValue: function() { >> + var last_value = this.target_element.value; >> + this.target_element.value = this.dateString(); >> + if (last_value!=this.target_element.value) this.callback("onchange"); >> + }, >> + today: function(now) { >> + var d = new Date(); this.date = new Date(); >> + var o = $H({ day: d.getDate(), month: d.getMonth(), year: d.getFullYear(), hour: d.getHours(), minute: d.getMinutes()}); >> + if ( ! now ) o = o.merge({hour: "", minute:""}); >> + this.updateSelectedDate(o, true); >> + this.refresh(); >> + }, >> + close: function() { >> + if (this.closed) return false; >> + this.callback("before_close"); >> + this.target_element.calendar_date_select = nil; >> + Event.stopObserving(document, "mousedown", this.closeIfClickedOut_handler); >> + Event.stopObserving(document, "keypress", this.keyPress_handler); >> + this.calendar_div.remove(); this.closed = true; >> + if (this.iframe) this.iframe.remove(); >> + if (this.target_element.type != "hidden" && ! this.target_element.disabled) this.target_element.focus(); >> + this.callback("after_close"); >> + }, >> + closeIfClickedOut: function(e) { >> + if (! $(Event.element(e)).descendantOf(this.calendar_div) ) this.close(); >> + }, >> + keyPress: function(e) { >> + if (e.keyCode==Event.KEY_ESC) this.close(); >> + }, >> + callback: function(name, param) { if (this.options.get(name)) { this.options.get(name).bind(this.target_element)(param); } } >> +} >> + >> + >> +//OFBiz addition: functions to call the calendar >> +function call_cal(target, datetime) { >> + new CalendarDateSelect(target, {time:true,year_range:10} ); >> +} >> + >> +function call_cal_notime(target, datetime) { >> + new CalendarDateSelect(target, {time:false,year_range:10} ); >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,34 @@ >> +// American Format: 12/31/2000 5:00 pm >> +// Thanks, Wes Hays >> +Date.prototype.toFormattedString = function(include_time){ >> + str = Date.padded2(this.getMonth() + 1) + '/' +Date.padded2(this.getDate()) + '/' + this.getFullYear(); >> + >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >> this.getAMPM() } >> + return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + // Test these with and without the time >> + // 11/11/1111 12pm >> + // 11/11/1111 1pm >> + // 1/11/1111 10:10pm >> + // 11/1/1111 01pm >> + // 1/1/1111 01:11pm >> + // 1/1/1111 1:11pm >> + var regexp = "(([0-1]?[0-9])\/[0-3]?[0-9]\/[0-9]{4}) *([0-9]{1,2}(:[0-9]{2})? *(am|pm))?"; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) { >> + return Date.parse(string); // Give javascript a chance to parse it. >> + } >> + >> + mdy = d[1].split('/'); >> + hrs = 0; >> + mts = 0; >> + if(d[3] != null) { >> + hrs = parseInt(d[3].split('')[0], 10); >> + if(d[5].toLowerCase() == 'pm') { hrs += 12; } // Add 12 more to hrs >> + mts = d[4].split(':')[1]; >> + } >> + >> + return new Date(mdy[2], parseInt(mdy[0], 10)-1, mdy[1], hrs, mts, 0); >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,27 @@ >> +// DB No Seconds Format: 2007-12-05 12:00 >> + >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >> padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >> 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + var regexp = '([0-9]{4})-(([0-9]{1,2})-(([0-9]{1,2})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + var date = new Date(d[1], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[5]); } >> + if (d[7]) { >> + date.setHours(parseInt(d[7], 10)); >> + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + return date; >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,12 @@ >> +// Time Format as "17:00" in DropDown Box >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >> padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >> 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +// Formats date and time as "01 January 2000 17:00" >> +Date.prototype.toFormattedString = function(include_time) >> +{ >> + str = Date.padded2(this.getDate()) + " " + Date.months[this.getMonth()] + " " + this.getFullYear(); >> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,12 @@ >> +// Time Format as "17:00" in DropDown Box >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >> padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >> 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +// Formats date and time as "2000.01.20 17:00" >> +Date.prototype.toFormattedString = function(include_time) >> +{ >> + str = this.getFullYear() + "." + Date.padded2(this.getMonth()+1) + "." + Date.padded2(this.getDate()); >> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,33 @@ >> +// Time Format as "17:00" in DropDown Box >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >> padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >> 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getDate() + "." + (this.getMonth() + 1) + "." + this.getFullYear(); >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> +Date.parseFormattedString = function (string) { >> + var regexp = '([0-9]{1,2})\.(([0-9]{1,2})\.(([0-9]{2,4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + if (d[5] && d[5].length == 2) { >> + // we got only two digits for the year... >> + d[5] = Number(d[5]); >> + if (d[5] > 30) >> + d[5] += 1900; >> + else >> + d[5] += 2000; >> + } >> + var date = new Date(d[5], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[1]); } >> + if (d[7]) { >> + date.setHours(parseInt(d[7], 10)); >> + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + return date; >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,37 @@ >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); >> + >> +if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >> this.getAMPM() } >> +return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + >> + "( ([0-9]{1,2}):([0-9]{2})? *(pm|am)" + >> + "?)?)?)?"; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + var date = new Date(d[1], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[5]); } >> + if (d[7]) { >> + hours = parseInt(d[7], 10); >> + offset=0; >> + if (d[9]) { >> + is_pm = (d[9].toLowerCase()=="pm"); >> + if (is_pm && hours <= 11) hours+=12; >> + if (!is_pm && hours == 12) hours=0; >> + } >> + date.setHours(hours); >> + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); } >> + if (d[14]) { >> + offset = (Number(d[16]) * 60) + Number(d[17]); >> + offset *= ((d[15] == '-') ? 1 : -1); >> + } >> + >> + return date; >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,46 @@ >> +Date.prototype.toFormattedString = function(include_time) { >> + var hour; >> + var str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); >> + if (include_time) { >> + hour = this.getHours(); >> + str += " " + this.getHours() + ":" + this.getPaddedMinutes(); >> + } >> + return str; >> +}; >> + >> +Date.parseFormattedString = function (string) { >> + >> + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + >> + "( ([0-9]{1,2}):([0-9]{2})?" + >> + "?)?)?)?"; >> + >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d === null) { >> + return Date.parse(string); // at least give javascript a crack at it. >> + } >> + var offset = 0; >> + var date = new Date(d[1], 0, 1); >> + if (d[3]) { >> + date.setMonth(d[3] - 1); >> + } >> + if (d[5]) { >> + date.setDate(d[5]); >> + } >> + if (d[7]) { >> + date.setHours(d[7]); >> + } >> + if (d[8]) { >> + date.setMinutes(d[8]); >> + } >> + if (d[0]) { >> + date.setSeconds(d[0]); >> + } >> + if (d[2]) { >> + date.setMilliseconds(Number("0." + d[2])); >> + } >> + if (d[4]) { >> + offset = (Number(d[6])) + Number(d[8]); >> + offset = ((d[5] == '-') ? 1 : -1); >> + } >> + return date; >> +}; >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,24 @@ >> +// Italian Format: 31/12/2000 23:00 >> +// Thanks, Bigonazzi! >> + >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getDate() + "/" + (this.getMonth() + 1) + "/" + this.getFullYear(); >> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + var regexp = '([0-9]{1,2})/(([0-9]{1,2})/(([0-9]{4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + var date = new Date(d[5], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[1]); } >> + if (d[7]) { >> + date.setHours(parseInt(d[7], 10)); >> + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + return date; >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,19 @@ >> +Date.weekdays = $w('Mo Di Mi Do Fr Sa So'); >> +Date.months = $w('Januar Februar März April Mai Juni Juli August September Oktober November Dezember'); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Jetzt", >> + "Today": "Heute", >> + "Clear": "Löschen" >> +} >> + >> +//load the data format >> +var dataFormatJs = "format_euro_24hr.js" >> + >> +var e = document.createElement("script"); >> +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; >> +e.type="text/javascript"; >> +document.getElementsByTagName("head")[0].appendChild(e); >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,11 @@ >> +Date.weekdays = $w("L M X J V S D"); >> +Date.months = $w("Enero Febrero Marzo Abril Mayo Junio Julio Agosto Septiembre Octubre Noviembre Diciembre" ); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "Cancelar", >> + "Now": "Ahora", >> + "Clear": "Limpiar", >> + "Today": "Hoy" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w("Ma Ti Ke To Pe La Su"); >> +Date.months = $w("Tammikuu Helmikuu Maaliskuu Huhtikuu Toukokuu Kesäkuu Heinäkuu Elokuu Syyskuu Lokakuu Marraskuu Joulukuu" ); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Nyt", >> + "Today": "Tänään" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,19 @@ >> +Date.weekdays = $w('L Ma Me J V S D'); >> +Date.months = $w('Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre'); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Maintenant", >> + "Today": "Aujourd'hui", >> + "Clear": "Effacer" >> +} >> + >> +//load the data format >> +var dataFormatJs = "format_euro_24hr.js" >> + >> +var e = document.createElement("script"); >> +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; >> +e.type="text/javascript"; >> +document.getElementsByTagName("head")[0].appendChild(e); >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,11 @@ >> +Date.weekdays = $w('Ma Di Wo Do Vr Za Zo'); >> +Date.months = $w('Januari Februari Maart April Mei Juni Juli Augustus September Oktober November December'); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Nu", >> + "Today": "Vandaag", >> + "Clear": "Wissen" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w('P W Å C P S N'); >> +Date.months = $w('StyczeÅ Luty Marzec KwiecieÅ Maj Czerwiec Lipiec SierpieÅ WrzesieÅ Październik Listopad GrudzieÅ'); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Teraz", >> + "Today": "DziÅ" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,11 @@ >> +Date.weekdays = $w('D S T Q Q S S'); >> +Date.months = $w('Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro'); >> + >> +Date.first_day_of_week = 0 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Agora", >> + "Today": "Hoje", >> + "Clear": "Limpar" >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w('Ðн ÐÑ Ð¡Ñ Ð§Ñ ÐÑ Ð¡Ð± ÐÑ?'); >> +Date.months = $w('ЯнваÑÑ Ð¤ÐµÐ²ÑÐ°Ð»Ñ ÐаÑÑ Ð?пÑÐµÐ»Ñ Ðай ÐÑÐ½Ñ ÐÑÐ»Ñ Ð?вгÑÑ?Ñ Ð¡ÐµÐ½ÑÑ?бÑÑ >> ÐкÑÑ?бÑÑ Ð?оÑ?бÑÑ ÐекабÑÑ'); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "СейÑаÑ?", >> + "Today": "СегоднÑ?" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w("? ? ? ? ? ? ?"); >> +Date.months = $w("? ? ? ? ? ? ? ? ? ? ?? ??" ); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "??", >> + "Now": "??", >> + "Today": "??" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Modified: ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl (original) >> +++ ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl Wed Dec 2 13:54:17 2009 >> @@ -26,8 +26,8 @@ >> <script language="javascript" src="/images/prototypejs/prototype.js" type="text/javascript"></script> >> <script language="javascript" src="/images/fieldlookup.js" type="text/javascript"></script> >> <script language="javascript" src="/images/selectall.js" type="text/javascript"></script> >> - <script language="javascript" src="/images/calendar_date_select.js" type="text/javascript"></script> >> - >> + <script language="javascript" src="/images/calendarDateSelect/calendar_date_select.js" type="text/javascript"></script> >> + <script language="javascript" >> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <link rel="stylesheet" href="/images/ecommain.css" type="text/css"/> >> <link rel="stylesheet" href="/ecommerce/images/blog.css" type="text/css"/> >> <link rel="stylesheet" href="/content/images/contentForum.css" type="text/css"/> >> >> Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl (original) >> +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl Wed Dec 2 13:54:17 2009 >> @@ -24,7 +24,8 @@ >> <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/prototype.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> + <script language="javascript" >> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale!}.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <link rel='stylesheet' href='<@ofbizContentUrl>/images/maincss.css</@ofbizContentUrl>' type='text/css'> >> <link rel='stylesheet' href='<@ofbizContentUrl>/images/tabstyles.css</@ofbizContentUrl>' type='text/css'> >> <link rel='stylesheet' href='<@ofbizContentUrl>/ecommerce/images/blog.css</@ofbizContentUrl>' type='text/css'> >> >> Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml (original) >> +++ ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 >> @@ -41,7 +41,8 @@ >> <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >> global="true"/> >> + <set field="layoutSettings.javaScripts[+0]" >> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >> @@ -222,7 +223,7 @@ >> </widgets> >> </section> >> </screen> >> - >> + >> <screen name="CommonPopUpDecorator"> >> <section> >> <actions> >> @@ -244,7 +245,8 @@ >> <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >> global="true"/> >> + <set field="layoutSettings.javaScripts[]" >> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >> >> >> > |
Administrator
|
In reply to this post by Bilgin Ibryam-2
Hi Bilgin,
Sorry I complety missed to answer you, I will do soon... Thanks Jacques From: "Bilgin Ibryam" <[hidden email]> > Hi Jacques, > > thanks for the nice localization. > I was wondering should we also add the js files in format and locale folders also to LICENSE file? > > Bilgin > > [hidden email] wrote: >> Author: jleroux >> Date: Wed Dec 2 13:54:17 2009 >> New Revision: 886143 >> >> URL: http://svn.apache.org/viewvc?rev=886143&view=rev >> Log: >> A patch from Sascha Rodekamp " Colors and localisation for the calendar" (https://issues.apache.org/jira/browse/OFBIZ-1825) - >> OFBIZ-1825 >> Simple and clear implementation! >> >> Added: >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/ >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/ >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (with props) >> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (with props) >> Removed: >> ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js >> Modified: >> ofbiz/trunk/LICENSE >> ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl >> ofbiz/trunk/framework/common/widget/CommonScreens.xml >> ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl >> ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl >> ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml >> >> Modified: ofbiz/trunk/LICENSE >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/LICENSE (original) >> +++ ofbiz/trunk/LICENSE Wed Dec 2 13:54:17 2009 >> @@ -1227,7 +1227,7 @@ >> ofbiz/trunk/framework/jetty/lib/slf4j-api-1.3.1.jar >> ofbiz/trunk/framework/jetty/lib/slf4j-log4j12-1.3.1.jar >> ofbiz/trunk/framework/images/webapp/images/htmledit/whizzywig_v55i.js >> -ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js >> +ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ========================================================================= >> The MIT License >> >> Modified: ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl (original) >> +++ ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl Wed Dec 2 13:54:17 2009 >> @@ -30,7 +30,8 @@ >> <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/scriptaculous.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> + <script language="javascript" >> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <#if layoutSettings.javaScripts?has_content> >> <#--layoutSettings.javaScripts is a list of java scripts. --> >> <#-- use a Set to make sure each javascript is declared only once, but iterate the list to maintain the correct >> order --> >> >> Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original) >> +++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 >> @@ -118,7 +118,8 @@ >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >> global="true"/> >> + <set field="layoutSettings.javaScripts[]" >> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapMarkers.js" global="true"/> >> <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" >> default-value="main" global="true"/> >> <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" default-value="BIZZNESS_TIME" >> global="true"/> >> @@ -289,7 +290,8 @@ >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >> global="true"/> >> + <set field="layoutSettings.javaScripts[]" >> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapSimple.js" global="true"/> >> <!-- The default (global) shortcut icon --> >> <set field="layoutSettings.shortcutIcon" value="/images/ofbiz.ico" global="true"/> >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,464 @@ >> +// CalendarDateSelect version 1.15 - a prototype based date picker >> +// Questions, comments, bugs? - see the project page: http://code.google.com/p/calendardateselect >> +if (typeof Prototype == 'undefined') alert("CalendarDateSelect Error: Prototype could not be found. Please make sure that your >> application's layout includes prototype.js (.g. <%= javascript_include_tag :defaults %>) *before* it includes >> calendar_date_select.js (.g. <%= calendar_date_select_includes %>)."); >> +if (Prototype.Version < "1.6") alert("Prototype 1.6.0 is required. If using earlier version of prototype, please use >> calendar_date_select version 1.8.3"); >> + >> +Element.addMethods({ >> + purgeChildren: function(element) { $A(element.childNodes).each(function(e){$(e).remove();}); }, >> + build: function(element, type, options, style) { >> + var newElement = Element.buildAndAppend(type, options, style); >> + element.appendChild(newElement); >> + return newElement; >> + } >> +}); >> + >> +Element.buildAndAppend = function(type, options, style) >> +{ >> + var e = $(document.createElement(type)); >> + $H(options).each(function(pair) { e[pair.key] = pair.value }); >> + if (style) e.setStyle(style); >> + return e; >> +}; >> +nil = null; >> + >> +Date.one_day = 24*60*60*1000; >> +Date.weekdays = $w("S M T W T F S"); >> +Date.first_day_of_week = 0; >> +Date.months = $w("January February March April May June July August September October November December" ); >> +Date.padded2 = function(hour) { var padded2 = parseInt(hour, 10); if (hour < 10) padded2 = "0" + padded2; return padded2; } >> +Date.prototype.getPaddedMinutes = function() { return Date.padded2(this.getMinutes()); } >> +Date.prototype.getAMPMHour = function() { var hour = this.getHours(); return (hour == 0) ? 12 : (hour > 12 ? hour - 12 : >> hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "AM" : "PM"; } >> +Date.prototype.stripTime = function() { return new Date(this.getFullYear(), this.getMonth(), this.getDate());}; >> +Date.prototype.daysDistance = function(compare_date) { return Math.round((compare_date - this) / Date.one_day); }; >> +Date.prototype.toFormattedString = function(include_time){ >> + var hour, str; >> + str = Date.months[this.getMonth()] + " " + this.getDate() + ", " + this.getFullYear(); >> + >> + if (include_time) { hour = this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >> this.getAMPM() } >> + return str; >> +} >> +/* mod for OFBiz Date Field */ >> + Date.prototype.toFormattedString_ofbiz_default = function(include_time){ >> + var hour, str; >> + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); >> + >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + ":" + >> this.getSeconds() + "." + this.getMilliseconds() } >> + return str; >> +} >> +/* mod end*/ >> +Date.parseFormattedString = function(string) { return new Date(string);} >> +Math.floor_to_interval = function(n, i) { return Math.floor(n/i) * i;} >> +window.f_height = function() { return( [window.innerHeight ? window.innerHeight : null, document.documentElement ? >> document.documentElement.clientHeight : null, document.body ? document.body.clientHeight : null].select(function(x){return >> x>0}).first()||0); } >> +window.f_scrollTop = function() { return ([window.pageYOffset ? window.pageYOffset : null, document.documentElement ? >> document.documentElement.scrollTop : null, document.body ? document.body.scrollTop : null].select(function(x){return >> x>0}).first()||0 ); } >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Now", >> + "Today": "Today", >> + "Clear": "Clear" >> +} >> +SelectBox = Class.create(); >> +SelectBox.prototype = { >> + initialize: function(parent_element, values, html_options, style_options) { >> + this.element = $(parent_element).build("select", html_options, style_options); >> + this.populate(values); >> + }, >> + populate: function(values) { >> + this.element.purgeChildren(); >> + var that = this; $A(values).each(function(pair) { if (typeof(pair)!="object") {pair = [pair, pair]}; >> that.element.build("option", { value: pair[1], innerHTML: pair[0]}) }); >> + }, >> + setValue: function(value) { >> + var e = this.element; >> + var matched = false; >> + $R(0, e.options.length - 1 ).each(function(i) { if(e.options[i].value==value.toString()) {e.selectedIndex = i; matched = >> true;}; } ); >> + return matched; >> + }, >> + getValue: function() { return $F(this.element)} >> +} >> +CalendarDateSelect = Class.create(); >> +CalendarDateSelect.prototype = { >> + initialize: function(target_element, options) { >> + this.target_element = $(target_element); // make sure it's an element, not a string >> + if (!this.target_element) { alert("Target element " + target_element + " not found!"); return false;} >> + if (this.target_element.tagName != "INPUT") this.target_element = this.target_element.down("INPUT") >> + >> + this.target_element.calendar_date_select = this; >> + this.last_click_at = 0; >> + // initialize the date control >> + this.options = $H({ >> + embedded: false, >> + popup: nil, >> + time: false, >> + buttons: true, >> + clear_button: true, >> + year_range: 10, >> + close_on_click: nil, >> + minute_interval: 5, >> + popup_by: this.target_element, >> + month_year: "dropdowns", >> + onchange: this.target_element.onchange, >> + valid_date_check: nil >> + }).merge(options || {}); >> + this.use_time = this.options.get("time"); >> + this.parseDate(); >> + this.callback("before_show") >> + this.initCalendarDiv(); >> + if(!this.options.get("embedded")) { >> + this.positionCalendarDiv() >> + // set the click handler to check if a user has clicked away from the document >> + Event.observe(document, "mousedown", this.closeIfClickedOut_handler = this.closeIfClickedOut.bindAsEventListener(this)); >> + Event.observe(document, "keypress", this.keyPress_handler = this.keyPress.bindAsEventListener(this)); >> + } >> + this.callback("after_show") >> + }, >> + positionCalendarDiv: function() { >> + var above = false; >> + var c_pos = this.calendar_div.cumulativeOffset(), c_left = c_pos[0], c_top = c_pos[1], c_dim = >> this.calendar_div.getDimensions(), c_height = c_dim.height, c_width = c_dim.width; >> + var w_top = window.f_scrollTop(), w_height = window.f_height(); >> + var e_dim = $(this.options.get("popup_by")).cumulativeOffset(), e_top = e_dim[1], e_left = e_dim[0], e_height = >> $(this.options.get("popup_by")).getDimensions().height, e_bottom = e_top + e_height; >> + >> + if ( (( e_bottom + c_height ) > (w_top + w_height)) && ( e_bottom - c_height > w_top )) above = true; >> + var left_px = e_left.toString() + "px", top_px = (above ? (e_top - c_height ) : ( e_top + e_height )).toString() + "px"; >> + >> + this.calendar_div.style.left = left_px; this.calendar_div.style.top = top_px; >> + >> + this.calendar_div.setStyle({visibility:""}); >> + >> + // draw an iframe behind the calendar -- ugly hack to make IE 6 happy >> + if(navigator.appName=="Microsoft Internet Explorer") this.iframe = $(document.body).build("iframe", {src: >> "javascript:false", className: "ie6_blocker"}, { left: left_px, top: top_px, height: c_height.toString()+"px", width: >> c_width.toString()+"px", border: "0px"}) >> + }, >> + initCalendarDiv: function() { >> + if (this.options.get("embedded")) { >> + var parent = this.target_element.parentNode; >> + var style = {} >> + } else { >> + var parent = document.body >> + var style = { position:"absolute", visibility: "hidden", left:0, top:0 } >> + } >> + this.calendar_div = $(parent).build('div', {className: "calendar_date_select"}, style); >> + >> + var that = this; >> + // create the divs >> + $w("top header body buttons footer bottom").each(function(name) { >> + eval("var " + name + "_div = that." + name + "_div = that.calendar_div.build('div', { className: 'cds_"+name+"' }, { >> clear: 'left'} ); "); >> + }); >> + >> + this.initHeaderDiv(); >> + this.initButtonsDiv(); >> + this.initCalendarGrid(); >> + this.updateFooter(" "); >> + >> + this.refresh(); >> + this.setUseTime(this.use_time); >> + }, >> + initHeaderDiv: function() { >> + var header_div = this.header_div; >> + this.close_button = header_div.build("a", { innerHTML: "x", href:"#", onclick:function () { this.close(); return >> false; }.bindAsEventListener(this), className: "close" }); >> + this.next_month_button = header_div.build("a", { innerHTML: ">", href:"#", onclick:function () { >> this.navMonth(this.date.getMonth() + 1 ); return false; }.bindAsEventListener(this), className: "next" }); >> + this.prev_month_button = header_div.build("a", { innerHTML: "<", href:"#", onclick:function () { >> this.navMonth(this.date.getMonth() - 1 ); return false; }.bindAsEventListener(this), className: "prev" }); >> + >> + if (this.options.get("month_year")=="dropdowns") { >> + this.month_select = new SelectBox(header_div, $R(0,11).map(function(m){return [Date.months[m], m]}), {className: "month", >> onchange: function () { this.navMonth(this.month_select.getValue()) }.bindAsEventListener(this)}); >> + this.year_select = new SelectBox(header_div, [], {className: "year", onchange: function () { >> this.navYear(this.year_select.getValue()) }.bindAsEventListener(this)}); >> + this.populateYearRange(); >> + } else { >> + this.month_year_label = header_div.build("span") >> + } >> + }, >> + initCalendarGrid: function() { >> + var body_div = this.body_div; >> + this.calendar_day_grid = []; >> + var days_table = body_div.build("table", { cellPadding: "0px", cellSpacing: "0px", width: "100%" }) >> + // make the weekdays! >> + var weekdays_row = days_table.build("thead").build("tr"); >> + Date.weekdays.each( function(weekday) { >> + weekdays_row.build("th", {innerHTML: weekday}); >> + }); >> + >> + var days_tbody = days_table.build("tbody") >> + // Make the days! >> + var row_number = 0, weekday; >> + for(var cell_index = 0; cell_index<42; cell_index++) >> + { >> + weekday = (cell_index+Date.first_day_of_week ) % 7; >> + if ( cell_index % 7==0 ) days_row = days_tbody.build("tr", {className: 'row_'+row_number++}); >> + (this.calendar_day_grid[cell_index] = days_row.build("td", { >> + calendar_date_select: this, >> + onmouseover: function () { this.calendar_date_select.dayHover(this); }, >> + onmouseout: function () { this.calendar_date_select.dayHoverOut(this) }, >> + onclick: function() { this.calendar_date_select.updateSelectedDate(this, true); }, >> + className: (weekday==0) || (weekday==6) ? " weekend" : "" //clear the class >> + }, >> + { cursor: "pointer" } >> + )).build("div"); >> + this.calendar_day_grid[cell_index]; >> + } >> + }, >> + initButtonsDiv: function() >> + { >> + var buttons_div = this.buttons_div; >> + if (this.options.get("time")) >> + { >> + var blank_time = $A(this.options.get("time")=="mixed" ? [[" - ", ""]] : []); >> + buttons_div.build("span", {innerHTML:"@", className: "at_sign"}); >> + >> + var t = new Date(); >> + this.hour_select = new SelectBox(buttons_div, >> + blank_time.concat($R(0,23).map(function(x) {t.setHours(x); return $A([t.getAMPMHour()+ " " + t.getAMPM(),x])} )), >> + { >> + calendar_date_select: this, >> + onchange: function() { this.calendar_date_select.updateSelectedDate( { hour: this.value });}, >> + className: "hour" >> + } >> + ); >> + buttons_div.build("span", {innerHTML:":", className: "seperator"}); >> + var that = this; >> + this.minute_select = new SelectBox(buttons_div, >> + blank_time.concat($R(0,59).select(function(x){return (x % that.options.get('minute_interval')==0)}).map(function(x){ >> return $A([ Date.padded2(x), x]); } ) ), >> + { >> + calendar_date_select: this, >> + onchange: function() { this.calendar_date_select.updateSelectedDate( {minute: this.value }) }, >> + className: "minute" >> + } >> + ); >> + >> + } else if (! this.options.get("buttons")) buttons_div.remove(); >> + >> + if (this.options.get("buttons")) { >> + buttons_div.build("span", {innerHTML: " "}); >> + if (this.options.get("time")=="mixed" || !this.options.get("time")) b = buttons_div.build("a", { >> + innerHTML: _translations["Today"], >> + href: "#", >> + onclick: function() {this.today(false); return false;}.bindAsEventListener(this) >> + }); >> + >> + if (this.options.get("time")=="mixed") buttons_div.build("span", {innerHTML: " | ", >> className:"button_seperator"}) >> + >> + if (this.options.get("time")) b = buttons_div.build("a", { >> + innerHTML: _translations["Now"], >> + href: "#", >> + onclick: function() {this.today(true); return false}.bindAsEventListener(this) >> + }); >> + >> + if (!this.options.get("embedded") && !this.closeOnClick()) >> + { >> + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >> + buttons_div.build("a", { innerHTML: _translations["OK"], href: "#", onclick: function() {this.close(); return >> false;}.bindAsEventListener(this) }); >> + } >> + if (this.options.get('clear_button')) { >> + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >> + buttons_div.build("a", { innerHTML: _translations["Clear"], href: "#", onclick: function() {this.clearDate(); if >> (!this.options.get("embedded")) this.close(); return false;}.bindAsEventListener(this) }); >> + } >> + } >> + }, >> + refresh: function () >> + { >> + this.refreshMonthYear(); >> + this.refreshCalendarGrid(); >> + >> + this.setSelectedClass(); >> + this.updateFooter(); >> + }, >> + refreshCalendarGrid: function () { >> + this.beginning_date = new Date(this.date).stripTime(); >> + this.beginning_date.setDate(1); >> + this.beginning_date.setHours(12); // Prevent daylight savings time boundaries from showing a duplicate day >> + var pre_days = this.beginning_date.getDay() // draw some days before the fact >> + if (pre_days < 3) pre_days += 7; >> + this.beginning_date.setDate(1 - pre_days + Date.first_day_of_week); >> + >> + var iterator = new Date(this.beginning_date); >> + >> + var today = new Date().stripTime(); >> + var this_month = this.date.getMonth(); >> + vdc = this.options.get("valid_date_check"); >> + for (var cell_index = 0;cell_index<42; cell_index++) >> + { >> + day = iterator.getDate(); month = iterator.getMonth(); >> + cell = this.calendar_day_grid[cell_index]; >> + Element.remove(cell.childNodes[0]); div = cell.build("div", {innerHTML:day}); >> + if (month!=this_month) div.className = "other"; >> + cell.day = day; cell.month = month; cell.year = iterator.getFullYear(); >> + if (vdc) { if (vdc(iterator.stripTime())) cell.removeClassName("disabled"); else cell.addClassName("disabled") }; >> + iterator.setDate( day + 1); >> + } >> + >> + if (this.today_cell) this.today_cell.removeClassName("today"); >> + >> + if ( $R( 0, 41 ).include(days_until = this.beginning_date.stripTime().daysDistance(today)) ) { >> + this.today_cell = this.calendar_day_grid[days_until]; >> + this.today_cell.addClassName("today"); >> + } >> + }, >> + refreshMonthYear: function() { >> + var m = this.date.getMonth(); >> + var y = this.date.getFullYear(); >> + // set the month >> + if (this.options.get("month_year") == "dropdowns") >> + { >> + this.month_select.setValue(m, false); >> + >> + var e = this.year_select.element; >> + if (this.flexibleYearRange() && (!(this.year_select.setValue(y, false)) || e.selectedIndex <= 1 || e.selectedIndex >= >> e.options.length - 2 )) this.populateYearRange(); >> + >> + this.year_select.setValue(y); >> + >> + } else { >> + this.month_year_label.update( Date.months[m] + " " + y.toString() ); >> + } >> + }, >> + populateYearRange: function() { >> + this.year_select.populate(this.yearRange().toArray()); >> + }, >> + yearRange: function() { >> + if (!this.flexibleYearRange()) >> + return $R(this.options.get("year_range")[0], this.options.get("year_range")[1]); >> + >> + var y = this.date.getFullYear(); >> + return $R(y - this.options.get("year_range"), y + this.options.get("year_range")); >> + }, >> + flexibleYearRange: function() { return (typeof(this.options.get("year_range")) == "number"); }, >> + validYear: function(year) { if (this.flexibleYearRange()) { return true;} else { return this.yearRange().include(year);} }, >> + dayHover: function(element) { >> + var hover_date = new Date(this.selected_date); >> + hover_date.setYear(element.year); hover_date.setMonth(element.month); hover_date.setDate(element.day); >> + this.updateFooter(hover_date.toFormattedString(this.use_time)); >> + }, >> + dayHoverOut: function(element) { this.updateFooter(); }, >> + clearSelectedClass: function() {if (this.selected_cell) this.selected_cell.removeClassName("selected");}, >> + setSelectedClass: function() { >> + if (!this.selection_made) return; >> + this.clearSelectedClass() >> + if ($R(0,42).include( days_until = this.beginning_date.stripTime().daysDistance(this.selected_date.stripTime()) )) { >> + this.selected_cell = this.calendar_day_grid[days_until]; >> + this.selected_cell.addClassName("selected"); >> + } >> + }, >> + reparse: function() { this.parseDate(); this.refresh(); }, >> + dateString: function() { >> + //mod for ofbiz Date input field, the return value will not be localized. >> + //return (this.selection_made) ? this.selected_date.toFormattedString(this.use_time) : " "; >> + return (this.selection_made) ? this.selected_date.toFormattedString_ofbiz_default(this.use_time) : " "; >> + }, >> + parseDate: function() >> + { >> + var value = $F(this.target_element).strip() >> + this.selection_made = (value != ""); >> + this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value); >> + if (isNaN(this.date)) this.date = new Date(); >> + if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? >> this.yearRange().start : this.yearRange().end); >> + this.selected_date = new Date(this.date); >> + this.use_time = /[0-9]:[0-9]{2}/.exec(value) ? true : false; >> + this.date.setDate(1); >> + }, >> + updateFooter:function(text) { if (!text) text = this.dateString(); this.footer_div.purgeChildren(); >> this.footer_div.build("span", {innerHTML: text }); }, >> + clearDate:function() { >> + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; >> + var last_value = this.target_element.value; >> + this.target_element.value = ""; >> + this.clearSelectedClass(); >> + this.updateFooter(' '); >> + if (last_value!=this.target_element.value) this.callback("onchange"); >> + }, >> + updateSelectedDate:function(partsOrElement, via_click) { >> + var parts = $H(partsOrElement); >> + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; >> + if (parts.get("day")) { >> + var t_selected_date = this.selected_date, vdc = this.options.get("valid_date_check"); >> + for (var x = 0; x<=3; x++) t_selected_date.setDate(parts.get("day")); >> + t_selected_date.setYear(parts.get("year")); >> + t_selected_date.setMonth(parts.get("month")); >> + >> + if (vdc && ! vdc(t_selected_date.stripTime())) { return false; } >> + this.selected_date = t_selected_date; >> + this.selection_made = true; >> + } >> + >> + if (!isNaN(parts.get("hour"))) this.selected_date.setHours(parts.get("hour")); >> + if (!isNaN(parts.get("minute"))) this.selected_date.setMinutes( Math.floor_to_interval(parts.get("minute"), >> this.options.get("minute_interval")) ); >> + if (parts.get("hour") === "" || parts.get("minute") === "") >> + this.setUseTime(false); >> + else if (!isNaN(parts.get("hour")) || !isNaN(parts.get("minute"))) >> + this.setUseTime(true); >> + >> + this.updateFooter(); >> + this.setSelectedClass(); >> + >> + if (this.selection_made) this.updateValue(); >> + if (this.closeOnClick()) { this.close(); } >> + if (via_click && !this.options.get("embedded")) { >> + if ((new Date() - this.last_click_at) < 333) this.close(); >> + this.last_click_at = new Date(); >> + } >> + }, >> + closeOnClick: function() { >> + if (this.options.get("embedded")) return false; >> + if (this.options.get("close_on_click")===nil ) >> + return (this.options.get("time")) ? false : true >> + else >> + return (this.options.get("close_on_click")) >> + }, >> + navMonth: function(month) { (target_date = new Date(this.date)).setMonth(month); return (this.navTo(target_date)); }, >> + navYear: function(year) { (target_date = new Date(this.date)).setYear(year); return (this.navTo(target_date)); }, >> + navTo: function(date) { >> + if (!this.validYear(date.getFullYear())) return false; >> + this.date = date; >> + this.date.setDate(1); >> + this.refresh(); >> + this.callback("after_navigate", this.date); >> + return true; >> + }, >> + setUseTime: function(turn_on) { >> + this.use_time = this.options.get("time") && (this.options.get("time")=="mixed" ? turn_on : true) // force use_time to true >> if time==true && time!="mixed" >> + if (this.use_time && this.selected_date) { // only set hour/minute if a date is already selected >> + var minute = Math.floor_to_interval(this.selected_date.getMinutes(), this.options.get("minute_interval")); >> + var hour = this.selected_date.getHours(); >> + >> + this.hour_select.setValue(hour); >> + this.minute_select.setValue(minute) >> + } else if (this.options.get("time")=="mixed") { >> + this.hour_select.setValue(""); this.minute_select.setValue(""); >> + } >> + }, >> + updateValue: function() { >> + var last_value = this.target_element.value; >> + this.target_element.value = this.dateString(); >> + if (last_value!=this.target_element.value) this.callback("onchange"); >> + }, >> + today: function(now) { >> + var d = new Date(); this.date = new Date(); >> + var o = $H({ day: d.getDate(), month: d.getMonth(), year: d.getFullYear(), hour: d.getHours(), minute: d.getMinutes()}); >> + if ( ! now ) o = o.merge({hour: "", minute:""}); >> + this.updateSelectedDate(o, true); >> + this.refresh(); >> + }, >> + close: function() { >> + if (this.closed) return false; >> + this.callback("before_close"); >> + this.target_element.calendar_date_select = nil; >> + Event.stopObserving(document, "mousedown", this.closeIfClickedOut_handler); >> + Event.stopObserving(document, "keypress", this.keyPress_handler); >> + this.calendar_div.remove(); this.closed = true; >> + if (this.iframe) this.iframe.remove(); >> + if (this.target_element.type != "hidden" && ! this.target_element.disabled) this.target_element.focus(); >> + this.callback("after_close"); >> + }, >> + closeIfClickedOut: function(e) { >> + if (! $(Event.element(e)).descendantOf(this.calendar_div) ) this.close(); >> + }, >> + keyPress: function(e) { >> + if (e.keyCode==Event.KEY_ESC) this.close(); >> + }, >> + callback: function(name, param) { if (this.options.get(name)) { this.options.get(name).bind(this.target_element)(param); } } >> +} >> + >> + >> +//OFBiz addition: functions to call the calendar >> +function call_cal(target, datetime) { >> + new CalendarDateSelect(target, {time:true,year_range:10} ); >> +} >> + >> +function call_cal_notime(target, datetime) { >> + new CalendarDateSelect(target, {time:false,year_range:10} ); >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,34 @@ >> +// American Format: 12/31/2000 5:00 pm >> +// Thanks, Wes Hays >> +Date.prototype.toFormattedString = function(include_time){ >> + str = Date.padded2(this.getMonth() + 1) + '/' +Date.padded2(this.getDate()) + '/' + this.getFullYear(); >> + >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >> this.getAMPM() } >> + return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + // Test these with and without the time >> + // 11/11/1111 12pm >> + // 11/11/1111 1pm >> + // 1/11/1111 10:10pm >> + // 11/1/1111 01pm >> + // 1/1/1111 01:11pm >> + // 1/1/1111 1:11pm >> + var regexp = "(([0-1]?[0-9])\/[0-3]?[0-9]\/[0-9]{4}) *([0-9]{1,2}(:[0-9]{2})? *(am|pm))?"; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) { >> + return Date.parse(string); // Give javascript a chance to parse it. >> + } >> + >> + mdy = d[1].split('/'); >> + hrs = 0; >> + mts = 0; >> + if(d[3] != null) { >> + hrs = parseInt(d[3].split('')[0], 10); >> + if(d[5].toLowerCase() == 'pm') { hrs += 12; } // Add 12 more to hrs >> + mts = d[4].split(':')[1]; >> + } >> + + return new Date(mdy[2], parseInt(mdy[0], 10)-1, mdy[1], hrs, mts, 0); >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,27 @@ >> +// DB No Seconds Format: 2007-12-05 12:00 >> + >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >> padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >> 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + var regexp = '([0-9]{4})-(([0-9]{1,2})-(([0-9]{1,2})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + var date = new Date(d[1], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[5]); } >> + if (d[7]) { >> + date.setHours(parseInt(d[7], 10)); + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + return date; >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,12 @@ >> +// Time Format as "17:00" in DropDown Box >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >> padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >> 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +// Formats date and time as "01 January 2000 17:00" >> +Date.prototype.toFormattedString = function(include_time) >> +{ >> + str = Date.padded2(this.getDate()) + " " + Date.months[this.getMonth()] + " " + this.getFullYear(); >> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,12 @@ >> +// Time Format as "17:00" in DropDown Box >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >> padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >> 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +// Formats date and time as "2000.01.20 17:00" >> +Date.prototype.toFormattedString = function(include_time) >> +{ >> + str = this.getFullYear() + "." + Date.padded2(this.getMonth()+1) + "." + Date.padded2(this.getDate()); >> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,33 @@ >> +// Time Format as "17:00" in DropDown Box >> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >> padded2; return padded2; } >> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >> 24 : hour ) } >> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >> + >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getDate() + "." + (this.getMonth() + 1) + "." + this.getFullYear(); >> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> +Date.parseFormattedString = function (string) { >> + var regexp = '([0-9]{1,2})\.(([0-9]{1,2})\.(([0-9]{2,4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + if (d[5] && d[5].length == 2) { >> + // we got only two digits for the year... >> + d[5] = Number(d[5]); >> + if (d[5] > 30) >> + d[5] += 1900; >> + else >> + d[5] += 2000; >> + } >> + var date = new Date(d[5], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[1]); } >> + if (d[7]) { >> + date.setHours(parseInt(d[7], 10)); >> + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + return date; >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,37 @@ >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); + >> +if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >> this.getAMPM() } >> +return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + >> + "( ([0-9]{1,2}):([0-9]{2})? *(pm|am)" + >> + "?)?)?)?"; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + var date = new Date(d[1], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[5]); } >> + if (d[7]) { >> + hours = parseInt(d[7], 10); >> + offset=0; >> + if (d[9]) { >> + is_pm = (d[9].toLowerCase()=="pm"); >> + if (is_pm && hours <= 11) hours+=12; >> + if (!is_pm && hours == 12) hours=0; >> + } >> + date.setHours(hours); + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); } >> + if (d[14]) { >> + offset = (Number(d[16]) * 60) + Number(d[17]); >> + offset *= ((d[15] == '-') ? 1 : -1); >> + } >> + >> + return date; >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,46 @@ >> +Date.prototype.toFormattedString = function(include_time) { >> + var hour; >> + var str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); >> + if (include_time) { >> + hour = this.getHours(); >> + str += " " + this.getHours() + ":" + this.getPaddedMinutes(); >> + } >> + return str; >> +}; >> + >> +Date.parseFormattedString = function (string) { >> + >> + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + + "( ([0-9]{1,2}):([0-9]{2})?" + >> + "?)?)?)?"; + >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d === null) { >> + return Date.parse(string); // at least give javascript a crack at it. >> + } >> + var offset = 0; + var date = new Date(d[1], 0, 1); + if (d[3]) { >> + date.setMonth(d[3] - 1); >> + } + if (d[5]) { >> + date.setDate(d[5]); >> + } + if (d[7]) { >> + date.setHours(d[7]); >> + } + if (d[8]) { >> + date.setMinutes(d[8]); >> + } + if (d[0]) { >> + date.setSeconds(d[0]); >> + } + if (d[2]) { >> + date.setMilliseconds(Number("0." + d[2])); >> + } + if (d[4]) { >> + offset = (Number(d[6])) + Number(d[8]); >> + offset = ((d[5] == '-') ? 1 : -1); + } + return date; +}; >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,24 @@ >> +// Italian Format: 31/12/2000 23:00 >> +// Thanks, Bigonazzi! >> + >> +Date.prototype.toFormattedString = function(include_time){ >> + str = this.getDate() + "/" + (this.getMonth() + 1) + "/" + this.getFullYear(); >> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >> + return str; >> +} >> + >> +Date.parseFormattedString = function (string) { >> + var regexp = '([0-9]{1,2})/(([0-9]{1,2})/(([0-9]{4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >> + var d = string.match(new RegExp(regexp, "i")); >> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >> + var offset = 0; >> + var date = new Date(d[5], 0, 1); >> + if (d[3]) { date.setMonth(d[3] - 1); } >> + if (d[5]) { date.setDate(d[1]); } >> + if (d[7]) { >> + date.setHours(parseInt(d[7], 10)); + } >> + if (d[8]) { date.setMinutes(d[8]); } >> + if (d[10]) { date.setSeconds(d[10]); } >> + return date; >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,19 @@ >> +Date.weekdays = $w('Mo Di Mi Do Fr Sa So'); >> +Date.months = $w('Januar Februar März April Mai Juni Juli August September Oktober November Dezember'); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Jetzt", >> + "Today": "Heute", >> + "Clear": "Löschen" >> +} >> + >> +//load the data format >> +var dataFormatJs = "format_euro_24hr.js" >> + >> +var e = document.createElement("script"); >> +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; >> +e.type="text/javascript"; >> +document.getElementsByTagName("head")[0].appendChild(e); >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,11 @@ >> +Date.weekdays = $w("L M X J V S D"); >> +Date.months = $w("Enero Febrero Marzo Abril Mayo Junio Julio Agosto Septiembre Octubre Noviembre Diciembre" ); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "Cancelar", >> + "Now": "Ahora", >> + "Clear": "Limpiar", >> + "Today": "Hoy" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w("Ma Ti Ke To Pe La Su"); >> +Date.months = $w("Tammikuu Helmikuu Maaliskuu Huhtikuu Toukokuu Kesäkuu Heinäkuu Elokuu Syyskuu Lokakuu Marraskuu Joulukuu" ); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Nyt", >> + "Today": "Tänään" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,19 @@ >> +Date.weekdays = $w('L Ma Me J V S D'); >> +Date.months = $w('Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre'); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Maintenant", >> + "Today": "Aujourd'hui", >> + "Clear": "Effacer" >> +} >> + >> +//load the data format >> +var dataFormatJs = "format_euro_24hr.js" >> + >> +var e = document.createElement("script"); >> +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; >> +e.type="text/javascript"; >> +document.getElementsByTagName("head")[0].appendChild(e); >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,11 @@ >> +Date.weekdays = $w('Ma Di Wo Do Vr Za Zo'); >> +Date.months = $w('Januari Februari Maart April Mei Juni Juli Augustus September Oktober November December'); >> + >> +Date.first_day_of_week = 1; >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Nu", >> + "Today": "Vandaag", >> + "Clear": "Wissen" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w('P W Å C P S N'); >> +Date.months = $w('StyczeÅ Luty Marzec KwiecieÅ Maj Czerwiec Lipiec SierpieÅ WrzesieÅ Październik Listopad GrudzieÅ'); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Teraz", >> + "Today": "DziÅ" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,11 @@ >> +Date.weekdays = $w('D S T Q Q S S'); >> +Date.months = $w('Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro'); >> + >> +Date.first_day_of_week = 0 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "Agora", >> + "Today": "Hoje", >> + "Clear": "Limpar" >> +} >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w('Ðн ÐÑ Ð¡Ñ Ð§Ñ ÐÑ Ð¡Ð± ÐÑ?'); >> +Date.months = $w('ЯнваÑÑ Ð¤ÐµÐ²ÑÐ°Ð»Ñ ÐаÑÑ Ð?пÑÐµÐ»Ñ Ðай ÐÑÐ½Ñ ÐÑÐ»Ñ Ð?вгÑÑ?Ñ Ð¡ÐµÐ½ÑÑ?бÑÑ >> ÐкÑÑ?бÑÑ Ð?оÑ?бÑÑ ÐекабÑÑ'); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "OK", >> + "Now": "СейÑаÑ?", >> + "Today": "СегоднÑ?" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js?rev=886143&view=auto >> ============================================================================== >> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (added) >> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js Wed Dec 2 13:54:17 2009 >> @@ -0,0 +1,10 @@ >> +Date.weekdays = $w("? ? ? ? ? ? ?"); >> +Date.months = $w("? ? ? ? ? ? ? ? ? ? ?? ??" ); >> + >> +Date.first_day_of_week = 1 >> + >> +_translations = { >> + "OK": "??", >> + "Now": "??", >> + "Today": "??" >> +} >> \ No newline at end of file >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> ------------------------------------------------------------------------------ >> svn:eol-style = native >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> ------------------------------------------------------------------------------ >> svn:keywords = "Date Rev Author URL Id" >> >> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >> ------------------------------------------------------------------------------ >> svn:mime-type = text/plain >> >> Modified: ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl (original) >> +++ ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl Wed Dec 2 13:54:17 2009 >> @@ -26,8 +26,8 @@ >> <script language="javascript" src="/images/prototypejs/prototype.js" type="text/javascript"></script> >> <script language="javascript" src="/images/fieldlookup.js" type="text/javascript"></script> >> <script language="javascript" src="/images/selectall.js" type="text/javascript"></script> >> - <script language="javascript" src="/images/calendar_date_select.js" type="text/javascript"></script> >> - >> + <script language="javascript" src="/images/calendarDateSelect/calendar_date_select.js" type="text/javascript"></script> >> + <script language="javascript" >> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <link rel="stylesheet" href="/images/ecommain.css" type="text/css"/> >> <link rel="stylesheet" href="/ecommerce/images/blog.css" type="text/css"/> >> <link rel="stylesheet" href="/content/images/contentForum.css" type="text/css"/> >> >> Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl (original) >> +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl Wed Dec 2 13:54:17 2009 >> @@ -24,7 +24,8 @@ >> <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/prototype.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> + <script language="javascript" >> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale!}.js</@ofbizContentUrl>" >> type="text/javascript"></script> >> <link rel='stylesheet' href='<@ofbizContentUrl>/images/maincss.css</@ofbizContentUrl>' type='text/css'> >> <link rel='stylesheet' href='<@ofbizContentUrl>/images/tabstyles.css</@ofbizContentUrl>' type='text/css'> >> <link rel='stylesheet' href='<@ofbizContentUrl>/ecommerce/images/blog.css</@ofbizContentUrl>' type='text/css'> >> >> Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff >> ============================================================================== >> --- ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml (original) >> +++ ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 >> @@ -41,7 +41,8 @@ >> <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >> global="true"/> >> + <set field="layoutSettings.javaScripts[+0]" >> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >> @@ -222,7 +223,7 @@ >> </widgets> >> </section> >> </screen> >> - + >> <screen name="CommonPopUpDecorator"> >> <section> >> <actions> >> @@ -244,7 +245,8 @@ >> <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> >> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >> global="true"/> >> + <set field="layoutSettings.javaScripts[]" >> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> >> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >> >> >> > |
Administrator
|
Bilgin,
I think it's ok as all the library is reffered into LICENCE as ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js So for me it implies all the files not licensed by us under this directory Jacques From: "Jacques Le Roux" <[hidden email]> > Hi Bilgin, > > Sorry I complety missed to answer you, I will do soon... > > Thanks > > Jacques > > From: "Bilgin Ibryam" <[hidden email]> >> Hi Jacques, >> >> thanks for the nice localization. >> I was wondering should we also add the js files in format and locale folders also to LICENSE file? >> >> Bilgin >> >> [hidden email] wrote: >>> Author: jleroux >>> Date: Wed Dec 2 13:54:17 2009 >>> New Revision: 886143 >>> >>> URL: http://svn.apache.org/viewvc?rev=886143&view=rev >>> Log: >>> A patch from Sascha Rodekamp " Colors and localisation for the calendar" (https://issues.apache.org/jira/browse/OFBIZ-1825) - >>> OFBIZ-1825 >>> Simple and clear implementation! >>> >>> Added: >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/ >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/ >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (with props) >>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (with props) >>> Removed: >>> ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js >>> Modified: >>> ofbiz/trunk/LICENSE >>> ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl >>> ofbiz/trunk/framework/common/widget/CommonScreens.xml >>> ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl >>> ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl >>> ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml >>> >>> Modified: ofbiz/trunk/LICENSE >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=886143&r1=886142&r2=886143&view=diff >>> ============================================================================== >>> --- ofbiz/trunk/LICENSE (original) >>> +++ ofbiz/trunk/LICENSE Wed Dec 2 13:54:17 2009 >>> @@ -1227,7 +1227,7 @@ >>> ofbiz/trunk/framework/jetty/lib/slf4j-api-1.3.1.jar >>> ofbiz/trunk/framework/jetty/lib/slf4j-log4j12-1.3.1.jar >>> ofbiz/trunk/framework/images/webapp/images/htmledit/whizzywig_v55i.js >>> -ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js >>> +ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >>> ========================================================================= >>> The MIT License >>> >>> Modified: ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl?rev=886143&r1=886142&r2=886143&view=diff >>> ============================================================================== >>> --- ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl (original) >>> +++ ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl Wed Dec 2 13:54:17 2009 >>> @@ -30,7 +30,8 @@ >>> <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/scriptaculous.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> + <script language="javascript" >>> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> <#if layoutSettings.javaScripts?has_content> >>> <#--layoutSettings.javaScripts is a list of java scripts. --> >>> <#-- use a Set to make sure each javascript is declared only once, but iterate the list to maintain the correct >>> order --> >>> >>> Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml >>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff >>> ============================================================================== >>> --- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original) >>> +++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 >>> @@ -118,7 +118,8 @@ >>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >>> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >>> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >>> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >>> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >>> global="true"/> >>> + <set field="layoutSettings.javaScripts[]" >>> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >>> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapMarkers.js" global="true"/> >>> <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" >>> default-value="main" global="true"/> >>> <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" default-value="BIZZNESS_TIME" >>> global="true"/> >>> @@ -289,7 +290,8 @@ >>> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >>> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >>> <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/> >>> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >>> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >>> global="true"/> >>> + <set field="layoutSettings.javaScripts[]" >>> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >>> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapSimple.js" global="true"/> >>> <!-- The default (global) shortcut icon --> >>> <set field="layoutSettings.shortcutIcon" value="/images/ofbiz.ico" global="true"/> >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,464 @@ >>> +// CalendarDateSelect version 1.15 - a prototype based date picker >>> +// Questions, comments, bugs? - see the project page: http://code.google.com/p/calendardateselect >>> +if (typeof Prototype == 'undefined') alert("CalendarDateSelect Error: Prototype could not be found. Please make sure that your >>> application's layout includes prototype.js (.g. <%= javascript_include_tag :defaults %>) *before* it includes >>> calendar_date_select.js (.g. <%= calendar_date_select_includes %>)."); >>> +if (Prototype.Version < "1.6") alert("Prototype 1.6.0 is required. If using earlier version of prototype, please use >>> calendar_date_select version 1.8.3"); >>> + >>> +Element.addMethods({ >>> + purgeChildren: function(element) { $A(element.childNodes).each(function(e){$(e).remove();}); }, >>> + build: function(element, type, options, style) { >>> + var newElement = Element.buildAndAppend(type, options, style); >>> + element.appendChild(newElement); >>> + return newElement; >>> + } >>> +}); >>> + >>> +Element.buildAndAppend = function(type, options, style) >>> +{ >>> + var e = $(document.createElement(type)); >>> + $H(options).each(function(pair) { e[pair.key] = pair.value }); >>> + if (style) e.setStyle(style); >>> + return e; >>> +}; >>> +nil = null; >>> + >>> +Date.one_day = 24*60*60*1000; >>> +Date.weekdays = $w("S M T W T F S"); >>> +Date.first_day_of_week = 0; >>> +Date.months = $w("January February March April May June July August September October November December" ); >>> +Date.padded2 = function(hour) { var padded2 = parseInt(hour, 10); if (hour < 10) padded2 = "0" + padded2; return padded2; } >>> +Date.prototype.getPaddedMinutes = function() { return Date.padded2(this.getMinutes()); } >>> +Date.prototype.getAMPMHour = function() { var hour = this.getHours(); return (hour == 0) ? 12 : (hour > 12 ? hour - 12 : >>> hour ) } >>> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "AM" : "PM"; } >>> +Date.prototype.stripTime = function() { return new Date(this.getFullYear(), this.getMonth(), this.getDate());}; >>> +Date.prototype.daysDistance = function(compare_date) { return Math.round((compare_date - this) / Date.one_day); }; >>> +Date.prototype.toFormattedString = function(include_time){ >>> + var hour, str; >>> + str = Date.months[this.getMonth()] + " " + this.getDate() + ", " + this.getFullYear(); >>> + >>> + if (include_time) { hour = this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >>> this.getAMPM() } >>> + return str; >>> +} >>> +/* mod for OFBiz Date Field */ >>> + Date.prototype.toFormattedString_ofbiz_default = function(include_time){ >>> + var hour, str; >>> + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); >>> + >>> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + ":" + >>> this.getSeconds() + "." + this.getMilliseconds() } >>> + return str; >>> +} >>> +/* mod end*/ >>> +Date.parseFormattedString = function(string) { return new Date(string);} >>> +Math.floor_to_interval = function(n, i) { return Math.floor(n/i) * i;} >>> +window.f_height = function() { return( [window.innerHeight ? window.innerHeight : null, document.documentElement ? >>> document.documentElement.clientHeight : null, document.body ? document.body.clientHeight : null].select(function(x){return >>> x>0}).first()||0); } >>> +window.f_scrollTop = function() { return ([window.pageYOffset ? window.pageYOffset : null, document.documentElement ? >>> document.documentElement.scrollTop : null, document.body ? document.body.scrollTop : null].select(function(x){return >>> x>0}).first()||0 ); } >>> + >>> +_translations = { >>> + "OK": "OK", >>> + "Now": "Now", >>> + "Today": "Today", >>> + "Clear": "Clear" >>> +} >>> +SelectBox = Class.create(); >>> +SelectBox.prototype = { >>> + initialize: function(parent_element, values, html_options, style_options) { >>> + this.element = $(parent_element).build("select", html_options, style_options); >>> + this.populate(values); >>> + }, >>> + populate: function(values) { >>> + this.element.purgeChildren(); >>> + var that = this; $A(values).each(function(pair) { if (typeof(pair)!="object") {pair = [pair, pair]}; >>> that.element.build("option", { value: pair[1], innerHTML: pair[0]}) }); >>> + }, >>> + setValue: function(value) { >>> + var e = this.element; >>> + var matched = false; >>> + $R(0, e.options.length - 1 ).each(function(i) { if(e.options[i].value==value.toString()) {e.selectedIndex = i; matched = >>> true;}; } ); >>> + return matched; >>> + }, >>> + getValue: function() { return $F(this.element)} >>> +} >>> +CalendarDateSelect = Class.create(); >>> +CalendarDateSelect.prototype = { >>> + initialize: function(target_element, options) { >>> + this.target_element = $(target_element); // make sure it's an element, not a string >>> + if (!this.target_element) { alert("Target element " + target_element + " not found!"); return false;} >>> + if (this.target_element.tagName != "INPUT") this.target_element = this.target_element.down("INPUT") >>> + >>> + this.target_element.calendar_date_select = this; >>> + this.last_click_at = 0; >>> + // initialize the date control >>> + this.options = $H({ >>> + embedded: false, >>> + popup: nil, >>> + time: false, >>> + buttons: true, >>> + clear_button: true, >>> + year_range: 10, >>> + close_on_click: nil, >>> + minute_interval: 5, >>> + popup_by: this.target_element, >>> + month_year: "dropdowns", >>> + onchange: this.target_element.onchange, >>> + valid_date_check: nil >>> + }).merge(options || {}); >>> + this.use_time = this.options.get("time"); >>> + this.parseDate(); >>> + this.callback("before_show") >>> + this.initCalendarDiv(); >>> + if(!this.options.get("embedded")) { >>> + this.positionCalendarDiv() >>> + // set the click handler to check if a user has clicked away from the document >>> + Event.observe(document, "mousedown", this.closeIfClickedOut_handler = this.closeIfClickedOut.bindAsEventListener(this)); >>> + Event.observe(document, "keypress", this.keyPress_handler = this.keyPress.bindAsEventListener(this)); >>> + } >>> + this.callback("after_show") >>> + }, >>> + positionCalendarDiv: function() { >>> + var above = false; >>> + var c_pos = this.calendar_div.cumulativeOffset(), c_left = c_pos[0], c_top = c_pos[1], c_dim = >>> this.calendar_div.getDimensions(), c_height = c_dim.height, c_width = c_dim.width; >>> + var w_top = window.f_scrollTop(), w_height = window.f_height(); >>> + var e_dim = $(this.options.get("popup_by")).cumulativeOffset(), e_top = e_dim[1], e_left = e_dim[0], e_height = >>> $(this.options.get("popup_by")).getDimensions().height, e_bottom = e_top + e_height; >>> + >>> + if ( (( e_bottom + c_height ) > (w_top + w_height)) && ( e_bottom - c_height > w_top )) above = true; >>> + var left_px = e_left.toString() + "px", top_px = (above ? (e_top - c_height ) : ( e_top + e_height )).toString() + "px"; >>> + >>> + this.calendar_div.style.left = left_px; this.calendar_div.style.top = top_px; >>> + >>> + this.calendar_div.setStyle({visibility:""}); >>> + >>> + // draw an iframe behind the calendar -- ugly hack to make IE 6 happy >>> + if(navigator.appName=="Microsoft Internet Explorer") this.iframe = $(document.body).build("iframe", {src: >>> "javascript:false", className: "ie6_blocker"}, { left: left_px, top: top_px, height: c_height.toString()+"px", width: >>> c_width.toString()+"px", border: "0px"}) >>> + }, >>> + initCalendarDiv: function() { >>> + if (this.options.get("embedded")) { >>> + var parent = this.target_element.parentNode; >>> + var style = {} >>> + } else { >>> + var parent = document.body >>> + var style = { position:"absolute", visibility: "hidden", left:0, top:0 } >>> + } >>> + this.calendar_div = $(parent).build('div', {className: "calendar_date_select"}, style); >>> + >>> + var that = this; >>> + // create the divs >>> + $w("top header body buttons footer bottom").each(function(name) { >>> + eval("var " + name + "_div = that." + name + "_div = that.calendar_div.build('div', { className: 'cds_"+name+"' }, { >>> clear: 'left'} ); "); >>> + }); >>> + >>> + this.initHeaderDiv(); >>> + this.initButtonsDiv(); >>> + this.initCalendarGrid(); >>> + this.updateFooter(" "); >>> + >>> + this.refresh(); >>> + this.setUseTime(this.use_time); >>> + }, >>> + initHeaderDiv: function() { >>> + var header_div = this.header_div; >>> + this.close_button = header_div.build("a", { innerHTML: "x", href:"#", onclick:function () { this.close(); return >>> false; }.bindAsEventListener(this), className: "close" }); >>> + this.next_month_button = header_div.build("a", { innerHTML: ">", href:"#", onclick:function () { >>> this.navMonth(this.date.getMonth() + 1 ); return false; }.bindAsEventListener(this), className: "next" }); >>> + this.prev_month_button = header_div.build("a", { innerHTML: "<", href:"#", onclick:function () { >>> this.navMonth(this.date.getMonth() - 1 ); return false; }.bindAsEventListener(this), className: "prev" }); >>> + >>> + if (this.options.get("month_year")=="dropdowns") { >>> + this.month_select = new SelectBox(header_div, $R(0,11).map(function(m){return [Date.months[m], m]}), {className: "month", >>> onchange: function () { this.navMonth(this.month_select.getValue()) }.bindAsEventListener(this)}); >>> + this.year_select = new SelectBox(header_div, [], {className: "year", onchange: function () { >>> this.navYear(this.year_select.getValue()) }.bindAsEventListener(this)}); >>> + this.populateYearRange(); >>> + } else { >>> + this.month_year_label = header_div.build("span") >>> + } >>> + }, >>> + initCalendarGrid: function() { >>> + var body_div = this.body_div; >>> + this.calendar_day_grid = []; >>> + var days_table = body_div.build("table", { cellPadding: "0px", cellSpacing: "0px", width: "100%" }) >>> + // make the weekdays! >>> + var weekdays_row = days_table.build("thead").build("tr"); >>> + Date.weekdays.each( function(weekday) { >>> + weekdays_row.build("th", {innerHTML: weekday}); >>> + }); >>> + >>> + var days_tbody = days_table.build("tbody") >>> + // Make the days! >>> + var row_number = 0, weekday; >>> + for(var cell_index = 0; cell_index<42; cell_index++) >>> + { >>> + weekday = (cell_index+Date.first_day_of_week ) % 7; >>> + if ( cell_index % 7==0 ) days_row = days_tbody.build("tr", {className: 'row_'+row_number++}); >>> + (this.calendar_day_grid[cell_index] = days_row.build("td", { >>> + calendar_date_select: this, >>> + onmouseover: function () { this.calendar_date_select.dayHover(this); }, >>> + onmouseout: function () { this.calendar_date_select.dayHoverOut(this) }, >>> + onclick: function() { this.calendar_date_select.updateSelectedDate(this, true); }, >>> + className: (weekday==0) || (weekday==6) ? " weekend" : "" //clear the class >>> + }, >>> + { cursor: "pointer" } >>> + )).build("div"); >>> + this.calendar_day_grid[cell_index]; >>> + } >>> + }, >>> + initButtonsDiv: function() >>> + { >>> + var buttons_div = this.buttons_div; >>> + if (this.options.get("time")) >>> + { >>> + var blank_time = $A(this.options.get("time")=="mixed" ? [[" - ", ""]] : []); >>> + buttons_div.build("span", {innerHTML:"@", className: "at_sign"}); >>> + >>> + var t = new Date(); >>> + this.hour_select = new SelectBox(buttons_div, >>> + blank_time.concat($R(0,23).map(function(x) {t.setHours(x); return $A([t.getAMPMHour()+ " " + t.getAMPM(),x])} )), >>> + { >>> + calendar_date_select: this, >>> + onchange: function() { this.calendar_date_select.updateSelectedDate( { hour: this.value });}, >>> + className: "hour" >>> + } >>> + ); >>> + buttons_div.build("span", {innerHTML:":", className: "seperator"}); >>> + var that = this; >>> + this.minute_select = new SelectBox(buttons_div, >>> + blank_time.concat($R(0,59).select(function(x){return (x % that.options.get('minute_interval')==0)}).map(function(x){ >>> return $A([ Date.padded2(x), x]); } ) ), >>> + { >>> + calendar_date_select: this, >>> + onchange: function() { this.calendar_date_select.updateSelectedDate( {minute: this.value }) }, >>> + className: "minute" >>> + } >>> + ); >>> + >>> + } else if (! this.options.get("buttons")) buttons_div.remove(); >>> + >>> + if (this.options.get("buttons")) { >>> + buttons_div.build("span", {innerHTML: " "}); >>> + if (this.options.get("time")=="mixed" || !this.options.get("time")) b = buttons_div.build("a", { >>> + innerHTML: _translations["Today"], >>> + href: "#", >>> + onclick: function() {this.today(false); return false;}.bindAsEventListener(this) >>> + }); >>> + >>> + if (this.options.get("time")=="mixed") buttons_div.build("span", {innerHTML: " | ", >>> className:"button_seperator"}) >>> + >>> + if (this.options.get("time")) b = buttons_div.build("a", { >>> + innerHTML: _translations["Now"], >>> + href: "#", >>> + onclick: function() {this.today(true); return false}.bindAsEventListener(this) >>> + }); >>> + >>> + if (!this.options.get("embedded") && !this.closeOnClick()) >>> + { >>> + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >>> + buttons_div.build("a", { innerHTML: _translations["OK"], href: "#", onclick: function() {this.close(); return >>> false;}.bindAsEventListener(this) }); >>> + } >>> + if (this.options.get('clear_button')) { >>> + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >>> + buttons_div.build("a", { innerHTML: _translations["Clear"], href: "#", onclick: function() {this.clearDate(); if >>> (!this.options.get("embedded")) this.close(); return false;}.bindAsEventListener(this) }); >>> + } >>> + } >>> + }, >>> + refresh: function () >>> + { >>> + this.refreshMonthYear(); >>> + this.refreshCalendarGrid(); >>> + >>> + this.setSelectedClass(); >>> + this.updateFooter(); >>> + }, >>> + refreshCalendarGrid: function () { >>> + this.beginning_date = new Date(this.date).stripTime(); >>> + this.beginning_date.setDate(1); >>> + this.beginning_date.setHours(12); // Prevent daylight savings time boundaries from showing a duplicate day >>> + var pre_days = this.beginning_date.getDay() // draw some days before the fact >>> + if (pre_days < 3) pre_days += 7; >>> + this.beginning_date.setDate(1 - pre_days + Date.first_day_of_week); >>> + >>> + var iterator = new Date(this.beginning_date); >>> + >>> + var today = new Date().stripTime(); >>> + var this_month = this.date.getMonth(); >>> + vdc = this.options.get("valid_date_check"); >>> + for (var cell_index = 0;cell_index<42; cell_index++) >>> + { >>> + day = iterator.getDate(); month = iterator.getMonth(); >>> + cell = this.calendar_day_grid[cell_index]; >>> + Element.remove(cell.childNodes[0]); div = cell.build("div", {innerHTML:day}); >>> + if (month!=this_month) div.className = "other"; >>> + cell.day = day; cell.month = month; cell.year = iterator.getFullYear(); >>> + if (vdc) { if (vdc(iterator.stripTime())) cell.removeClassName("disabled"); else cell.addClassName("disabled") }; >>> + iterator.setDate( day + 1); >>> + } >>> + >>> + if (this.today_cell) this.today_cell.removeClassName("today"); >>> + >>> + if ( $R( 0, 41 ).include(days_until = this.beginning_date.stripTime().daysDistance(today)) ) { >>> + this.today_cell = this.calendar_day_grid[days_until]; >>> + this.today_cell.addClassName("today"); >>> + } >>> + }, >>> + refreshMonthYear: function() { >>> + var m = this.date.getMonth(); >>> + var y = this.date.getFullYear(); >>> + // set the month >>> + if (this.options.get("month_year") == "dropdowns") >>> + { >>> + this.month_select.setValue(m, false); >>> + >>> + var e = this.year_select.element; >>> + if (this.flexibleYearRange() && (!(this.year_select.setValue(y, false)) || e.selectedIndex <= 1 || e.selectedIndex >= >>> e.options.length - 2 )) this.populateYearRange(); >>> + >>> + this.year_select.setValue(y); >>> + >>> + } else { >>> + this.month_year_label.update( Date.months[m] + " " + y.toString() ); >>> + } >>> + }, >>> + populateYearRange: function() { >>> + this.year_select.populate(this.yearRange().toArray()); >>> + }, >>> + yearRange: function() { >>> + if (!this.flexibleYearRange()) >>> + return $R(this.options.get("year_range")[0], this.options.get("year_range")[1]); >>> + >>> + var y = this.date.getFullYear(); >>> + return $R(y - this.options.get("year_range"), y + this.options.get("year_range")); >>> + }, >>> + flexibleYearRange: function() { return (typeof(this.options.get("year_range")) == "number"); }, >>> + validYear: function(year) { if (this.flexibleYearRange()) { return true;} else { return this.yearRange().include(year);} }, >>> + dayHover: function(element) { >>> + var hover_date = new Date(this.selected_date); >>> + hover_date.setYear(element.year); hover_date.setMonth(element.month); hover_date.setDate(element.day); >>> + this.updateFooter(hover_date.toFormattedString(this.use_time)); >>> + }, >>> + dayHoverOut: function(element) { this.updateFooter(); }, >>> + clearSelectedClass: function() {if (this.selected_cell) this.selected_cell.removeClassName("selected");}, >>> + setSelectedClass: function() { >>> + if (!this.selection_made) return; >>> + this.clearSelectedClass() >>> + if ($R(0,42).include( days_until = this.beginning_date.stripTime().daysDistance(this.selected_date.stripTime()) )) { >>> + this.selected_cell = this.calendar_day_grid[days_until]; >>> + this.selected_cell.addClassName("selected"); >>> + } >>> + }, >>> + reparse: function() { this.parseDate(); this.refresh(); }, >>> + dateString: function() { >>> + //mod for ofbiz Date input field, the return value will not be localized. >>> + //return (this.selection_made) ? this.selected_date.toFormattedString(this.use_time) : " "; >>> + return (this.selection_made) ? this.selected_date.toFormattedString_ofbiz_default(this.use_time) : " "; >>> + }, >>> + parseDate: function() >>> + { >>> + var value = $F(this.target_element).strip() >>> + this.selection_made = (value != ""); >>> + this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value); >>> + if (isNaN(this.date)) this.date = new Date(); >>> + if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? >>> this.yearRange().start : this.yearRange().end); >>> + this.selected_date = new Date(this.date); >>> + this.use_time = /[0-9]:[0-9]{2}/.exec(value) ? true : false; >>> + this.date.setDate(1); >>> + }, >>> + updateFooter:function(text) { if (!text) text = this.dateString(); this.footer_div.purgeChildren(); >>> this.footer_div.build("span", {innerHTML: text }); }, >>> + clearDate:function() { >>> + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; >>> + var last_value = this.target_element.value; >>> + this.target_element.value = ""; >>> + this.clearSelectedClass(); >>> + this.updateFooter(' '); >>> + if (last_value!=this.target_element.value) this.callback("onchange"); >>> + }, >>> + updateSelectedDate:function(partsOrElement, via_click) { >>> + var parts = $H(partsOrElement); >>> + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; >>> + if (parts.get("day")) { >>> + var t_selected_date = this.selected_date, vdc = this.options.get("valid_date_check"); >>> + for (var x = 0; x<=3; x++) t_selected_date.setDate(parts.get("day")); >>> + t_selected_date.setYear(parts.get("year")); >>> + t_selected_date.setMonth(parts.get("month")); >>> + >>> + if (vdc && ! vdc(t_selected_date.stripTime())) { return false; } >>> + this.selected_date = t_selected_date; >>> + this.selection_made = true; >>> + } >>> + >>> + if (!isNaN(parts.get("hour"))) this.selected_date.setHours(parts.get("hour")); >>> + if (!isNaN(parts.get("minute"))) this.selected_date.setMinutes( Math.floor_to_interval(parts.get("minute"), >>> this.options.get("minute_interval")) ); >>> + if (parts.get("hour") === "" || parts.get("minute") === "") >>> + this.setUseTime(false); >>> + else if (!isNaN(parts.get("hour")) || !isNaN(parts.get("minute"))) >>> + this.setUseTime(true); >>> + >>> + this.updateFooter(); >>> + this.setSelectedClass(); >>> + >>> + if (this.selection_made) this.updateValue(); >>> + if (this.closeOnClick()) { this.close(); } >>> + if (via_click && !this.options.get("embedded")) { >>> + if ((new Date() - this.last_click_at) < 333) this.close(); >>> + this.last_click_at = new Date(); >>> + } >>> + }, >>> + closeOnClick: function() { >>> + if (this.options.get("embedded")) return false; >>> + if (this.options.get("close_on_click")===nil ) >>> + return (this.options.get("time")) ? false : true >>> + else >>> + return (this.options.get("close_on_click")) >>> + }, >>> + navMonth: function(month) { (target_date = new Date(this.date)).setMonth(month); return (this.navTo(target_date)); }, >>> + navYear: function(year) { (target_date = new Date(this.date)).setYear(year); return (this.navTo(target_date)); }, >>> + navTo: function(date) { >>> + if (!this.validYear(date.getFullYear())) return false; >>> + this.date = date; >>> + this.date.setDate(1); >>> + this.refresh(); >>> + this.callback("after_navigate", this.date); >>> + return true; >>> + }, >>> + setUseTime: function(turn_on) { >>> + this.use_time = this.options.get("time") && (this.options.get("time")=="mixed" ? turn_on : true) // force use_time to true >>> if time==true && time!="mixed" >>> + if (this.use_time && this.selected_date) { // only set hour/minute if a date is already selected >>> + var minute = Math.floor_to_interval(this.selected_date.getMinutes(), this.options.get("minute_interval")); >>> + var hour = this.selected_date.getHours(); >>> + >>> + this.hour_select.setValue(hour); >>> + this.minute_select.setValue(minute) >>> + } else if (this.options.get("time")=="mixed") { >>> + this.hour_select.setValue(""); this.minute_select.setValue(""); >>> + } >>> + }, >>> + updateValue: function() { >>> + var last_value = this.target_element.value; >>> + this.target_element.value = this.dateString(); >>> + if (last_value!=this.target_element.value) this.callback("onchange"); >>> + }, >>> + today: function(now) { >>> + var d = new Date(); this.date = new Date(); >>> + var o = $H({ day: d.getDate(), month: d.getMonth(), year: d.getFullYear(), hour: d.getHours(), minute: d.getMinutes()}); >>> + if ( ! now ) o = o.merge({hour: "", minute:""}); >>> + this.updateSelectedDate(o, true); >>> + this.refresh(); >>> + }, >>> + close: function() { >>> + if (this.closed) return false; >>> + this.callback("before_close"); >>> + this.target_element.calendar_date_select = nil; >>> + Event.stopObserving(document, "mousedown", this.closeIfClickedOut_handler); >>> + Event.stopObserving(document, "keypress", this.keyPress_handler); >>> + this.calendar_div.remove(); this.closed = true; >>> + if (this.iframe) this.iframe.remove(); >>> + if (this.target_element.type != "hidden" && ! this.target_element.disabled) this.target_element.focus(); >>> + this.callback("after_close"); >>> + }, >>> + closeIfClickedOut: function(e) { >>> + if (! $(Event.element(e)).descendantOf(this.calendar_div) ) this.close(); >>> + }, >>> + keyPress: function(e) { >>> + if (e.keyCode==Event.KEY_ESC) this.close(); >>> + }, >>> + callback: function(name, param) { if (this.options.get(name)) { this.options.get(name).bind(this.target_element)(param); } } >>> +} >>> + >>> + >>> +//OFBiz addition: functions to call the calendar >>> +function call_cal(target, datetime) { >>> + new CalendarDateSelect(target, {time:true,year_range:10} ); >>> +} >>> + >>> +function call_cal_notime(target, datetime) { >>> + new CalendarDateSelect(target, {time:false,year_range:10} ); >>> +} >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,34 @@ >>> +// American Format: 12/31/2000 5:00 pm >>> +// Thanks, Wes Hays >>> +Date.prototype.toFormattedString = function(include_time){ >>> + str = Date.padded2(this.getMonth() + 1) + '/' +Date.padded2(this.getDate()) + '/' + this.getFullYear(); >>> + >>> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >>> this.getAMPM() } >>> + return str; >>> +} >>> + >>> +Date.parseFormattedString = function (string) { >>> + // Test these with and without the time >>> + // 11/11/1111 12pm >>> + // 11/11/1111 1pm >>> + // 1/11/1111 10:10pm >>> + // 11/1/1111 01pm >>> + // 1/1/1111 01:11pm >>> + // 1/1/1111 1:11pm >>> + var regexp = "(([0-1]?[0-9])\/[0-3]?[0-9]\/[0-9]{4}) *([0-9]{1,2}(:[0-9]{2})? *(am|pm))?"; >>> + var d = string.match(new RegExp(regexp, "i")); >>> + if (d==null) { >>> + return Date.parse(string); // Give javascript a chance to parse it. >>> + } >>> + >>> + mdy = d[1].split('/'); >>> + hrs = 0; >>> + mts = 0; >>> + if(d[3] != null) { >>> + hrs = parseInt(d[3].split('')[0], 10); >>> + if(d[5].toLowerCase() == 'pm') { hrs += 12; } // Add 12 more to hrs >>> + mts = d[4].split(':')[1]; >>> + } >>> + + return new Date(mdy[2], parseInt(mdy[0], 10)-1, mdy[1], hrs, mts, 0); >>> +} >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,27 @@ >>> +// DB No Seconds Format: 2007-12-05 12:00 >>> + >>> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >>> padded2; return padded2; } >>> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >>> 24 : hour ) } >>> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >>> + >>> +Date.prototype.toFormattedString = function(include_time){ >>> + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); >>> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } >>> + return str; >>> +} >>> + >>> +Date.parseFormattedString = function (string) { >>> + var regexp = '([0-9]{4})-(([0-9]{1,2})-(([0-9]{1,2})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >>> + var d = string.match(new RegExp(regexp, "i")); >>> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >>> + var offset = 0; >>> + var date = new Date(d[1], 0, 1); >>> + if (d[3]) { date.setMonth(d[3] - 1); } >>> + if (d[5]) { date.setDate(d[5]); } >>> + if (d[7]) { >>> + date.setHours(parseInt(d[7], 10)); + } >>> + if (d[8]) { date.setMinutes(d[8]); } >>> + if (d[10]) { date.setSeconds(d[10]); } >>> + return date; >>> +} >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,12 @@ >>> +// Time Format as "17:00" in DropDown Box >>> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >>> padded2; return padded2; } >>> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >>> 24 : hour ) } >>> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >>> + >>> +// Formats date and time as "01 January 2000 17:00" >>> +Date.prototype.toFormattedString = function(include_time) >>> +{ >>> + str = Date.padded2(this.getDate()) + " " + Date.months[this.getMonth()] + " " + this.getFullYear(); >>> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >>> + return str; >>> +} >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,12 @@ >>> +// Time Format as "17:00" in DropDown Box >>> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >>> padded2; return padded2; } >>> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >>> 24 : hour ) } >>> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >>> + >>> +// Formats date and time as "2000.01.20 17:00" >>> +Date.prototype.toFormattedString = function(include_time) >>> +{ >>> + str = this.getFullYear() + "." + Date.padded2(this.getMonth()+1) + "." + Date.padded2(this.getDate()); >>> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >>> + return str; >>> +} >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,33 @@ >>> +// Time Format as "17:00" in DropDown Box >>> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + >>> padded2; return padded2; } >>> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >>> 24 : hour ) } >>> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >>> + >>> +Date.prototype.toFormattedString = function(include_time){ >>> + str = this.getDate() + "." + (this.getMonth() + 1) + "." + this.getFullYear(); >>> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } >>> + return str; >>> +} >>> +Date.parseFormattedString = function (string) { >>> + var regexp = '([0-9]{1,2})\.(([0-9]{1,2})\.(([0-9]{2,4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >>> + var d = string.match(new RegExp(regexp, "i")); >>> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >>> + var offset = 0; >>> + if (d[5] && d[5].length == 2) { >>> + // we got only two digits for the year... >>> + d[5] = Number(d[5]); >>> + if (d[5] > 30) >>> + d[5] += 1900; >>> + else >>> + d[5] += 2000; >>> + } >>> + var date = new Date(d[5], 0, 1); >>> + if (d[3]) { date.setMonth(d[3] - 1); } >>> + if (d[5]) { date.setDate(d[1]); } >>> + if (d[7]) { >>> + date.setHours(parseInt(d[7], 10)); >>> + } >>> + if (d[8]) { date.setMinutes(d[8]); } >>> + if (d[10]) { date.setSeconds(d[10]); } >>> + return date; >>> +} >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,37 @@ >>> +Date.prototype.toFormattedString = function(include_time){ >>> + str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); + >>> +if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >>> this.getAMPM() } >>> +return str; >>> +} >>> + >>> +Date.parseFormattedString = function (string) { >>> + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + >>> + "( ([0-9]{1,2}):([0-9]{2})? *(pm|am)" + >>> + "?)?)?)?"; >>> + var d = string.match(new RegExp(regexp, "i")); >>> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >>> + var offset = 0; >>> + var date = new Date(d[1], 0, 1); >>> + if (d[3]) { date.setMonth(d[3] - 1); } >>> + if (d[5]) { date.setDate(d[5]); } >>> + if (d[7]) { >>> + hours = parseInt(d[7], 10); >>> + offset=0; >>> + if (d[9]) { >>> + is_pm = (d[9].toLowerCase()=="pm"); >>> + if (is_pm && hours <= 11) hours+=12; >>> + if (!is_pm && hours == 12) hours=0; >>> + } >>> + date.setHours(hours); + } >>> + if (d[8]) { date.setMinutes(d[8]); } >>> + if (d[10]) { date.setSeconds(d[10]); } >>> + if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); } >>> + if (d[14]) { >>> + offset = (Number(d[16]) * 60) + Number(d[17]); >>> + offset *= ((d[15] == '-') ? 1 : -1); >>> + } >>> + >>> + return date; >>> +} >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,46 @@ >>> +Date.prototype.toFormattedString = function(include_time) { >>> + var hour; >>> + var str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); >>> + if (include_time) { >>> + hour = this.getHours(); >>> + str += " " + this.getHours() + ":" + this.getPaddedMinutes(); >>> + } >>> + return str; >>> +}; >>> + >>> +Date.parseFormattedString = function (string) { >>> + >>> + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + + "( ([0-9]{1,2}):([0-9]{2})?" + >>> + "?)?)?)?"; + >>> + var d = string.match(new RegExp(regexp, "i")); >>> + if (d === null) { >>> + return Date.parse(string); // at least give javascript a crack at it. >>> + } >>> + var offset = 0; + var date = new Date(d[1], 0, 1); + if (d[3]) { >>> + date.setMonth(d[3] - 1); >>> + } + if (d[5]) { >>> + date.setDate(d[5]); >>> + } + if (d[7]) { >>> + date.setHours(d[7]); >>> + } + if (d[8]) { >>> + date.setMinutes(d[8]); >>> + } + if (d[0]) { >>> + date.setSeconds(d[0]); >>> + } + if (d[2]) { >>> + date.setMilliseconds(Number("0." + d[2])); >>> + } + if (d[4]) { >>> + offset = (Number(d[6])) + Number(d[8]); >>> + offset = ((d[5] == '-') ? 1 : -1); + } + return date; +}; >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,24 @@ >>> +// Italian Format: 31/12/2000 23:00 >>> +// Thanks, Bigonazzi! >>> + >>> +Date.prototype.toFormattedString = function(include_time){ >>> + str = this.getDate() + "/" + (this.getMonth() + 1) + "/" + this.getFullYear(); >>> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >>> + return str; >>> +} >>> + >>> +Date.parseFormattedString = function (string) { >>> + var regexp = '([0-9]{1,2})/(([0-9]{1,2})/(([0-9]{4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >>> + var d = string.match(new RegExp(regexp, "i")); >>> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >>> + var offset = 0; >>> + var date = new Date(d[5], 0, 1); >>> + if (d[3]) { date.setMonth(d[3] - 1); } >>> + if (d[5]) { date.setDate(d[1]); } >>> + if (d[7]) { >>> + date.setHours(parseInt(d[7], 10)); + } >>> + if (d[8]) { date.setMinutes(d[8]); } >>> + if (d[10]) { date.setSeconds(d[10]); } >>> + return date; >>> +} >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,19 @@ >>> +Date.weekdays = $w('Mo Di Mi Do Fr Sa So'); >>> +Date.months = $w('Januar Februar März April Mai Juni Juli August September Oktober November Dezember'); >>> + >>> +Date.first_day_of_week = 1; >>> + >>> +_translations = { >>> + "OK": "OK", >>> + "Now": "Jetzt", >>> + "Today": "Heute", >>> + "Clear": "Löschen" >>> +} >>> + >>> +//load the data format >>> +var dataFormatJs = "format_euro_24hr.js" >>> + >>> +var e = document.createElement("script"); >>> +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; >>> +e.type="text/javascript"; >>> +document.getElementsByTagName("head")[0].appendChild(e); >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,11 @@ >>> +Date.weekdays = $w("L M X J V S D"); >>> +Date.months = $w("Enero Febrero Marzo Abril Mayo Junio Julio Agosto Septiembre Octubre Noviembre Diciembre" ); >>> + >>> +Date.first_day_of_week = 1; >>> + >>> +_translations = { >>> + "OK": "Cancelar", >>> + "Now": "Ahora", >>> + "Clear": "Limpiar", >>> + "Today": "Hoy" >>> +} >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,10 @@ >>> +Date.weekdays = $w("Ma Ti Ke To Pe La Su"); >>> +Date.months = $w("Tammikuu Helmikuu Maaliskuu Huhtikuu Toukokuu Kesäkuu Heinäkuu Elokuu Syyskuu Lokakuu Marraskuu Joulukuu" ); >>> + >>> +Date.first_day_of_week = 1 >>> + >>> +_translations = { >>> + "OK": "OK", >>> + "Now": "Nyt", >>> + "Today": "Tänään" >>> +} >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,19 @@ >>> +Date.weekdays = $w('L Ma Me J V S D'); >>> +Date.months = $w('Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre'); >>> + >>> +Date.first_day_of_week = 1; >>> + >>> +_translations = { >>> + "OK": "OK", >>> + "Now": "Maintenant", >>> + "Today": "Aujourd'hui", >>> + "Clear": "Effacer" >>> +} >>> + >>> +//load the data format >>> +var dataFormatJs = "format_euro_24hr.js" >>> + >>> +var e = document.createElement("script"); >>> +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; >>> +e.type="text/javascript"; >>> +document.getElementsByTagName("head")[0].appendChild(e); >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,11 @@ >>> +Date.weekdays = $w('Ma Di Wo Do Vr Za Zo'); >>> +Date.months = $w('Januari Februari Maart April Mei Juni Juli Augustus September Oktober November December'); >>> + >>> +Date.first_day_of_week = 1; >>> + >>> +_translations = { >>> + "OK": "OK", >>> + "Now": "Nu", >>> + "Today": "Vandaag", >>> + "Clear": "Wissen" >>> +} >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,10 @@ >>> +Date.weekdays = $w('P W Å C P S N'); >>> +Date.months = $w('StyczeÅ Luty Marzec KwiecieÅ Maj Czerwiec Lipiec SierpieÅ WrzesieÅ Październik Listopad GrudzieÅ'); >>> + >>> +Date.first_day_of_week = 1 >>> + >>> +_translations = { >>> + "OK": "OK", >>> + "Now": "Teraz", >>> + "Today": "DziÅ" >>> +} >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,11 @@ >>> +Date.weekdays = $w('D S T Q Q S S'); >>> +Date.months = $w('Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro'); >>> + >>> +Date.first_day_of_week = 0 >>> + >>> +_translations = { >>> + "OK": "OK", >>> + "Now": "Agora", >>> + "Today": "Hoje", >>> + "Clear": "Limpar" >>> +} >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,10 @@ >>> +Date.weekdays = $w('Ðн ÐÑ Ð¡Ñ Ð§Ñ ÐÑ Ð¡Ð± ÐÑ?'); >>> +Date.months = $w('ЯнваÑÑ Ð¤ÐµÐ²ÑÐ°Ð»Ñ ÐаÑÑ Ð?пÑÐµÐ»Ñ Ðай ÐÑÐ½Ñ ÐÑÐ»Ñ Ð?вгÑÑ?Ñ Ð¡ÐµÐ½ÑÑ?бÑÑ >>> ÐкÑÑ?бÑÑ Ð?оÑ?бÑÑ ÐекабÑÑ'); >>> + >>> +Date.first_day_of_week = 1 >>> + >>> +_translations = { >>> + "OK": "OK", >>> + "Now": "СейÑаÑ?", >>> + "Today": "СегоднÑ?" >>> +} >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js?rev=886143&view=auto >>> ============================================================================== >>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (added) >>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js Wed Dec 2 13:54:17 2009 >>> @@ -0,0 +1,10 @@ >>> +Date.weekdays = $w("? ? ? ? ? ? ?"); >>> +Date.months = $w("? ? ? ? ? ? ? ? ? ? ?? ??" ); >>> + >>> +Date.first_day_of_week = 1 >>> + >>> +_translations = { >>> + "OK": "??", >>> + "Now": "??", >>> + "Today": "??" >>> +} >>> \ No newline at end of file >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >>> ------------------------------------------------------------------------------ >>> svn:eol-style = native >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >>> ------------------------------------------------------------------------------ >>> svn:keywords = "Date Rev Author URL Id" >>> >>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >>> ------------------------------------------------------------------------------ >>> svn:mime-type = text/plain >>> >>> Modified: ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl?rev=886143&r1=886142&r2=886143&view=diff >>> ============================================================================== >>> --- ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl (original) >>> +++ ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl Wed Dec 2 13:54:17 2009 >>> @@ -26,8 +26,8 @@ >>> <script language="javascript" src="/images/prototypejs/prototype.js" type="text/javascript"></script> >>> <script language="javascript" src="/images/fieldlookup.js" type="text/javascript"></script> >>> <script language="javascript" src="/images/selectall.js" type="text/javascript"></script> >>> - <script language="javascript" src="/images/calendar_date_select.js" type="text/javascript"></script> >>> - >>> + <script language="javascript" src="/images/calendarDateSelect/calendar_date_select.js" type="text/javascript"></script> >>> + <script language="javascript" >>> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> <link rel="stylesheet" href="/images/ecommain.css" type="text/css"/> >>> <link rel="stylesheet" href="/ecommerce/images/blog.css" type="text/css"/> >>> <link rel="stylesheet" href="/content/images/contentForum.css" type="text/css"/> >>> >>> Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl?rev=886143&r1=886142&r2=886143&view=diff >>> ============================================================================== >>> --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl (original) >>> +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl Wed Dec 2 13:54:17 2009 >>> @@ -24,7 +24,8 @@ >>> <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/prototype.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> + <script language="javascript" src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> + <script language="javascript" >>> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale!}.js</@ofbizContentUrl>" >>> type="text/javascript"></script> >>> <link rel='stylesheet' href='<@ofbizContentUrl>/images/maincss.css</@ofbizContentUrl>' type='text/css'> >>> <link rel='stylesheet' href='<@ofbizContentUrl>/images/tabstyles.css</@ofbizContentUrl>' type='text/css'> >>> <link rel='stylesheet' href='<@ofbizContentUrl>/ecommerce/images/blog.css</@ofbizContentUrl>' type='text/css'> >>> >>> Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml >>> URL: >>> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff >>> ============================================================================== >>> --- ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml (original) >>> +++ ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 >>> @@ -41,7 +41,8 @@ >>> <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> >>> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >>> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >>> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >>> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >>> global="true"/> >>> + <set field="layoutSettings.javaScripts[+0]" >>> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> >>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> >>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >>> @@ -222,7 +223,7 @@ >>> </widgets> >>> </section> >>> </screen> >>> - + >>> <screen name="CommonPopUpDecorator"> >>> <section> >>> <actions> >>> @@ -244,7 +245,8 @@ >>> <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> >>> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >>> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >>> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >>> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >>> global="true"/> >>> + <set field="layoutSettings.javaScripts[]" >>> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> >>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> >>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >>> >>> >>> >> > > |
Administrator
|
I stumbled upon this one by chance. In Jquery branch I have only used
ofbiz/trunk/framework/images/webapp/images/jquery/* Much simple to maintain Jacques From: "Jacques Le Roux" <[hidden email]> > Bilgin, > > I think it's ok as all the library is reffered into LICENCE as > ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js > So for me it implies all the files not licensed by us under this directory > Jacques > > From: "Jacques Le Roux" <[hidden email]> >> Hi Bilgin, >> >> Sorry I complety missed to answer you, I will do soon... >> >> Thanks >> >> Jacques >> >> From: "Bilgin Ibryam" <[hidden email]> >>> Hi Jacques, >>> >>> thanks for the nice localization. >>> I was wondering should we also add the js files in format and locale folders also to LICENSE file? >>> >>> Bilgin >>> >>> [hidden email] wrote: >>>> Author: jleroux >>>> Date: Wed Dec 2 13:54:17 2009 >>>> New Revision: 886143 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=886143&view=rev >>>> Log: >>>> A patch from Sascha Rodekamp " Colors and localisation for the calendar" (https://issues.apache.org/jira/browse/OFBIZ-1825) - >>>> OFBIZ-1825 >>>> Simple and clear implementation! >>>> >>>> Added: >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/ >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/ >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (with props) >>>> ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (with props) >>>> Removed: >>>> ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js >>>> Modified: >>>> ofbiz/trunk/LICENSE >>>> ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl >>>> ofbiz/trunk/framework/common/widget/CommonScreens.xml >>>> ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl >>>> ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl >>>> ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml >>>> >>>> Modified: ofbiz/trunk/LICENSE >>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=886143&r1=886142&r2=886143&view=diff >>>> ============================================================================== >>>> --- ofbiz/trunk/LICENSE (original) >>>> +++ ofbiz/trunk/LICENSE Wed Dec 2 13:54:17 2009 >>>> @@ -1227,7 +1227,7 @@ >>>> ofbiz/trunk/framework/jetty/lib/slf4j-api-1.3.1.jar >>>> ofbiz/trunk/framework/jetty/lib/slf4j-log4j12-1.3.1.jar >>>> ofbiz/trunk/framework/images/webapp/images/htmledit/whizzywig_v55i.js >>>> -ofbiz/trunk/framework/images/webapp/images/calendar_date_select.js >>>> +ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >>>> ========================================================================= >>>> The MIT License >>>> >>>> Modified: ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl?rev=886143&r1=886142&r2=886143&view=diff >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl (original) >>>> +++ ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl Wed Dec 2 13:54:17 2009 >>>> @@ -30,7 +30,8 @@ >>>> <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/scriptaculous.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> + <script language="javascript" >>>> src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script> >>>> + <script language="javascript" >>>> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> <#if layoutSettings.javaScripts?has_content> >>>> <#--layoutSettings.javaScripts is a list of java scripts. --> >>>> <#-- use a Set to make sure each javascript is declared only once, but iterate the list to maintain the correct >>>> order --> >>>> >>>> Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original) >>>> +++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 >>>> @@ -118,7 +118,8 @@ >>>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >>>> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >>>> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >>>> global="true"/> >>>> + <set field="layoutSettings.javaScripts[]" >>>> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapMarkers.js" global="true"/> >>>> <set field="layoutSettings.commonHeaderImageLinkUrl" from-field="layoutSettings.commonHeaderImageLinkUrl" >>>> default-value="main" global="true"/> >>>> <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" default-value="BIZZNESS_TIME" >>>> global="true"/> >>>> @@ -289,7 +290,8 @@ >>>> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[]" value="/images/prototypejs/prototype.js" global="true"/> >>>> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >>>> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >>>> global="true"/> >>>> + <set field="layoutSettings.javaScripts[]" >>>> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[]" value="/images/GooglemapSimple.js" global="true"/> >>>> <!-- The default (global) shortcut icon --> >>>> <set field="layoutSettings.shortcutIcon" value="/images/ofbiz.ico" global="true"/> >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,464 @@ >>>> +// CalendarDateSelect version 1.15 - a prototype based date picker >>>> +// Questions, comments, bugs? - see the project page: http://code.google.com/p/calendardateselect >>>> +if (typeof Prototype == 'undefined') alert("CalendarDateSelect Error: Prototype could not be found. Please make sure that your >>>> application's layout includes prototype.js (.g. <%= javascript_include_tag :defaults %>) *before* it includes >>>> calendar_date_select.js (.g. <%= calendar_date_select_includes %>)."); >>>> +if (Prototype.Version < "1.6") alert("Prototype 1.6.0 is required. If using earlier version of prototype, please use >>>> calendar_date_select version 1.8.3"); >>>> + >>>> +Element.addMethods({ >>>> + purgeChildren: function(element) { $A(element.childNodes).each(function(e){$(e).remove();}); }, >>>> + build: function(element, type, options, style) { >>>> + var newElement = Element.buildAndAppend(type, options, style); >>>> + element.appendChild(newElement); >>>> + return newElement; >>>> + } >>>> +}); >>>> + >>>> +Element.buildAndAppend = function(type, options, style) >>>> +{ >>>> + var e = $(document.createElement(type)); >>>> + $H(options).each(function(pair) { e[pair.key] = pair.value }); >>>> + if (style) e.setStyle(style); >>>> + return e; >>>> +}; >>>> +nil = null; >>>> + >>>> +Date.one_day = 24*60*60*1000; >>>> +Date.weekdays = $w("S M T W T F S"); >>>> +Date.first_day_of_week = 0; >>>> +Date.months = $w("January February March April May June July August September October November December" ); >>>> +Date.padded2 = function(hour) { var padded2 = parseInt(hour, 10); if (hour < 10) padded2 = "0" + padded2; return padded2; } >>>> +Date.prototype.getPaddedMinutes = function() { return Date.padded2(this.getMinutes()); } >>>> +Date.prototype.getAMPMHour = function() { var hour = this.getHours(); return (hour == 0) ? 12 : (hour > 12 ? hour - 12 : >>>> hour ) } >>>> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "AM" : "PM"; } >>>> +Date.prototype.stripTime = function() { return new Date(this.getFullYear(), this.getMonth(), this.getDate());}; >>>> +Date.prototype.daysDistance = function(compare_date) { return Math.round((compare_date - this) / Date.one_day); }; >>>> +Date.prototype.toFormattedString = function(include_time){ >>>> + var hour, str; >>>> + str = Date.months[this.getMonth()] + " " + this.getDate() + ", " + this.getFullYear(); >>>> + >>>> + if (include_time) { hour = this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >>>> this.getAMPM() } >>>> + return str; >>>> +} >>>> +/* mod for OFBiz Date Field */ >>>> + Date.prototype.toFormattedString_ofbiz_default = function(include_time){ >>>> + var hour, str; >>>> + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); >>>> + >>>> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + ":" + >>>> this.getSeconds() + "." + this.getMilliseconds() } >>>> + return str; >>>> +} >>>> +/* mod end*/ >>>> +Date.parseFormattedString = function(string) { return new Date(string);} >>>> +Math.floor_to_interval = function(n, i) { return Math.floor(n/i) * i;} >>>> +window.f_height = function() { return( [window.innerHeight ? window.innerHeight : null, document.documentElement ? >>>> document.documentElement.clientHeight : null, document.body ? document.body.clientHeight : null].select(function(x){return >>>> x>0}).first()||0); } >>>> +window.f_scrollTop = function() { return ([window.pageYOffset ? window.pageYOffset : null, document.documentElement ? >>>> document.documentElement.scrollTop : null, document.body ? document.body.scrollTop : null].select(function(x){return >>>> x>0}).first()||0 ); } >>>> + >>>> +_translations = { >>>> + "OK": "OK", >>>> + "Now": "Now", >>>> + "Today": "Today", >>>> + "Clear": "Clear" >>>> +} >>>> +SelectBox = Class.create(); >>>> +SelectBox.prototype = { >>>> + initialize: function(parent_element, values, html_options, style_options) { >>>> + this.element = $(parent_element).build("select", html_options, style_options); >>>> + this.populate(values); >>>> + }, >>>> + populate: function(values) { >>>> + this.element.purgeChildren(); >>>> + var that = this; $A(values).each(function(pair) { if (typeof(pair)!="object") {pair = [pair, pair]}; >>>> that.element.build("option", { value: pair[1], innerHTML: pair[0]}) }); >>>> + }, >>>> + setValue: function(value) { >>>> + var e = this.element; >>>> + var matched = false; >>>> + $R(0, e.options.length - 1 ).each(function(i) { if(e.options[i].value==value.toString()) {e.selectedIndex = i; matched = >>>> true;}; } ); >>>> + return matched; >>>> + }, >>>> + getValue: function() { return $F(this.element)} >>>> +} >>>> +CalendarDateSelect = Class.create(); >>>> +CalendarDateSelect.prototype = { >>>> + initialize: function(target_element, options) { >>>> + this.target_element = $(target_element); // make sure it's an element, not a string >>>> + if (!this.target_element) { alert("Target element " + target_element + " not found!"); return false;} >>>> + if (this.target_element.tagName != "INPUT") this.target_element = this.target_element.down("INPUT") >>>> + >>>> + this.target_element.calendar_date_select = this; >>>> + this.last_click_at = 0; >>>> + // initialize the date control >>>> + this.options = $H({ >>>> + embedded: false, >>>> + popup: nil, >>>> + time: false, >>>> + buttons: true, >>>> + clear_button: true, >>>> + year_range: 10, >>>> + close_on_click: nil, >>>> + minute_interval: 5, >>>> + popup_by: this.target_element, >>>> + month_year: "dropdowns", >>>> + onchange: this.target_element.onchange, >>>> + valid_date_check: nil >>>> + }).merge(options || {}); >>>> + this.use_time = this.options.get("time"); >>>> + this.parseDate(); >>>> + this.callback("before_show") >>>> + this.initCalendarDiv(); >>>> + if(!this.options.get("embedded")) { >>>> + this.positionCalendarDiv() >>>> + // set the click handler to check if a user has clicked away from the document >>>> + Event.observe(document, "mousedown", this.closeIfClickedOut_handler = this.closeIfClickedOut.bindAsEventListener(this)); >>>> + Event.observe(document, "keypress", this.keyPress_handler = this.keyPress.bindAsEventListener(this)); >>>> + } >>>> + this.callback("after_show") >>>> + }, >>>> + positionCalendarDiv: function() { >>>> + var above = false; >>>> + var c_pos = this.calendar_div.cumulativeOffset(), c_left = c_pos[0], c_top = c_pos[1], c_dim = >>>> this.calendar_div.getDimensions(), c_height = c_dim.height, c_width = c_dim.width; >>>> + var w_top = window.f_scrollTop(), w_height = window.f_height(); >>>> + var e_dim = $(this.options.get("popup_by")).cumulativeOffset(), e_top = e_dim[1], e_left = e_dim[0], e_height = >>>> $(this.options.get("popup_by")).getDimensions().height, e_bottom = e_top + e_height; >>>> + >>>> + if ( (( e_bottom + c_height ) > (w_top + w_height)) && ( e_bottom - c_height > w_top )) above = true; >>>> + var left_px = e_left.toString() + "px", top_px = (above ? (e_top - c_height ) : ( e_top + e_height )).toString() + "px"; >>>> + >>>> + this.calendar_div.style.left = left_px; this.calendar_div.style.top = top_px; >>>> + >>>> + this.calendar_div.setStyle({visibility:""}); >>>> + >>>> + // draw an iframe behind the calendar -- ugly hack to make IE 6 happy >>>> + if(navigator.appName=="Microsoft Internet Explorer") this.iframe = $(document.body).build("iframe", {src: >>>> "javascript:false", className: "ie6_blocker"}, { left: left_px, top: top_px, height: c_height.toString()+"px", width: >>>> c_width.toString()+"px", border: "0px"}) >>>> + }, >>>> + initCalendarDiv: function() { >>>> + if (this.options.get("embedded")) { >>>> + var parent = this.target_element.parentNode; >>>> + var style = {} >>>> + } else { >>>> + var parent = document.body >>>> + var style = { position:"absolute", visibility: "hidden", left:0, top:0 } >>>> + } >>>> + this.calendar_div = $(parent).build('div', {className: "calendar_date_select"}, style); >>>> + >>>> + var that = this; >>>> + // create the divs >>>> + $w("top header body buttons footer bottom").each(function(name) { >>>> + eval("var " + name + "_div = that." + name + "_div = that.calendar_div.build('div', { className: 'cds_"+name+"' }, { >>>> clear: 'left'} ); "); >>>> + }); >>>> + >>>> + this.initHeaderDiv(); >>>> + this.initButtonsDiv(); >>>> + this.initCalendarGrid(); >>>> + this.updateFooter(" "); >>>> + >>>> + this.refresh(); >>>> + this.setUseTime(this.use_time); >>>> + }, >>>> + initHeaderDiv: function() { >>>> + var header_div = this.header_div; >>>> + this.close_button = header_div.build("a", { innerHTML: "x", href:"#", onclick:function () { this.close(); return >>>> false; }.bindAsEventListener(this), className: "close" }); >>>> + this.next_month_button = header_div.build("a", { innerHTML: ">", href:"#", onclick:function () { >>>> this.navMonth(this.date.getMonth() + 1 ); return false; }.bindAsEventListener(this), className: "next" }); >>>> + this.prev_month_button = header_div.build("a", { innerHTML: "<", href:"#", onclick:function () { >>>> this.navMonth(this.date.getMonth() - 1 ); return false; }.bindAsEventListener(this), className: "prev" }); >>>> + >>>> + if (this.options.get("month_year")=="dropdowns") { >>>> + this.month_select = new SelectBox(header_div, $R(0,11).map(function(m){return [Date.months[m], m]}), {className: >>>> "month", onchange: function () { this.navMonth(this.month_select.getValue()) }.bindAsEventListener(this)}); >>>> + this.year_select = new SelectBox(header_div, [], {className: "year", onchange: function () { >>>> this.navYear(this.year_select.getValue()) }.bindAsEventListener(this)}); >>>> + this.populateYearRange(); >>>> + } else { >>>> + this.month_year_label = header_div.build("span") >>>> + } >>>> + }, >>>> + initCalendarGrid: function() { >>>> + var body_div = this.body_div; >>>> + this.calendar_day_grid = []; >>>> + var days_table = body_div.build("table", { cellPadding: "0px", cellSpacing: "0px", width: "100%" }) >>>> + // make the weekdays! >>>> + var weekdays_row = days_table.build("thead").build("tr"); >>>> + Date.weekdays.each( function(weekday) { >>>> + weekdays_row.build("th", {innerHTML: weekday}); >>>> + }); >>>> + >>>> + var days_tbody = days_table.build("tbody") >>>> + // Make the days! >>>> + var row_number = 0, weekday; >>>> + for(var cell_index = 0; cell_index<42; cell_index++) >>>> + { >>>> + weekday = (cell_index+Date.first_day_of_week ) % 7; >>>> + if ( cell_index % 7==0 ) days_row = days_tbody.build("tr", {className: 'row_'+row_number++}); >>>> + (this.calendar_day_grid[cell_index] = days_row.build("td", { >>>> + calendar_date_select: this, >>>> + onmouseover: function () { this.calendar_date_select.dayHover(this); }, >>>> + onmouseout: function () { this.calendar_date_select.dayHoverOut(this) }, >>>> + onclick: function() { this.calendar_date_select.updateSelectedDate(this, true); }, >>>> + className: (weekday==0) || (weekday==6) ? " weekend" : "" //clear the class >>>> + }, >>>> + { cursor: "pointer" } >>>> + )).build("div"); >>>> + this.calendar_day_grid[cell_index]; >>>> + } >>>> + }, >>>> + initButtonsDiv: function() >>>> + { >>>> + var buttons_div = this.buttons_div; >>>> + if (this.options.get("time")) >>>> + { >>>> + var blank_time = $A(this.options.get("time")=="mixed" ? [[" - ", ""]] : []); >>>> + buttons_div.build("span", {innerHTML:"@", className: "at_sign"}); >>>> + >>>> + var t = new Date(); >>>> + this.hour_select = new SelectBox(buttons_div, >>>> + blank_time.concat($R(0,23).map(function(x) {t.setHours(x); return $A([t.getAMPMHour()+ " " + t.getAMPM(),x])} )), >>>> + { >>>> + calendar_date_select: this, >>>> + onchange: function() { this.calendar_date_select.updateSelectedDate( { hour: this.value });}, >>>> + className: "hour" >>>> + } >>>> + ); >>>> + buttons_div.build("span", {innerHTML:":", className: "seperator"}); >>>> + var that = this; >>>> + this.minute_select = new SelectBox(buttons_div, >>>> + blank_time.concat($R(0,59).select(function(x){return (x % that.options.get('minute_interval')==0)}).map(function(x){ >>>> return $A([ Date.padded2(x), x]); } ) ), >>>> + { >>>> + calendar_date_select: this, >>>> + onchange: function() { this.calendar_date_select.updateSelectedDate( {minute: this.value }) }, >>>> + className: "minute" >>>> + } >>>> + ); >>>> + >>>> + } else if (! this.options.get("buttons")) buttons_div.remove(); >>>> + >>>> + if (this.options.get("buttons")) { >>>> + buttons_div.build("span", {innerHTML: " "}); >>>> + if (this.options.get("time")=="mixed" || !this.options.get("time")) b = buttons_div.build("a", { >>>> + innerHTML: _translations["Today"], >>>> + href: "#", >>>> + onclick: function() {this.today(false); return false;}.bindAsEventListener(this) >>>> + }); >>>> + >>>> + if (this.options.get("time")=="mixed") buttons_div.build("span", {innerHTML: " | ", >>>> className:"button_seperator"}) >>>> + >>>> + if (this.options.get("time")) b = buttons_div.build("a", { >>>> + innerHTML: _translations["Now"], >>>> + href: "#", >>>> + onclick: function() {this.today(true); return false}.bindAsEventListener(this) >>>> + }); >>>> + >>>> + if (!this.options.get("embedded") && !this.closeOnClick()) >>>> + { >>>> + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >>>> + buttons_div.build("a", { innerHTML: _translations["OK"], href: "#", onclick: function() {this.close(); return >>>> false;}.bindAsEventListener(this) }); >>>> + } >>>> + if (this.options.get('clear_button')) { >>>> + buttons_div.build("span", {innerHTML: " | ", className:"button_seperator"}) >>>> + buttons_div.build("a", { innerHTML: _translations["Clear"], href: "#", onclick: function() {this.clearDate(); if >>>> (!this.options.get("embedded")) this.close(); return false;}.bindAsEventListener(this) }); >>>> + } >>>> + } >>>> + }, >>>> + refresh: function () >>>> + { >>>> + this.refreshMonthYear(); >>>> + this.refreshCalendarGrid(); >>>> + >>>> + this.setSelectedClass(); >>>> + this.updateFooter(); >>>> + }, >>>> + refreshCalendarGrid: function () { >>>> + this.beginning_date = new Date(this.date).stripTime(); >>>> + this.beginning_date.setDate(1); >>>> + this.beginning_date.setHours(12); // Prevent daylight savings time boundaries from showing a duplicate day >>>> + var pre_days = this.beginning_date.getDay() // draw some days before the fact >>>> + if (pre_days < 3) pre_days += 7; >>>> + this.beginning_date.setDate(1 - pre_days + Date.first_day_of_week); >>>> + >>>> + var iterator = new Date(this.beginning_date); >>>> + >>>> + var today = new Date().stripTime(); >>>> + var this_month = this.date.getMonth(); >>>> + vdc = this.options.get("valid_date_check"); >>>> + for (var cell_index = 0;cell_index<42; cell_index++) >>>> + { >>>> + day = iterator.getDate(); month = iterator.getMonth(); >>>> + cell = this.calendar_day_grid[cell_index]; >>>> + Element.remove(cell.childNodes[0]); div = cell.build("div", {innerHTML:day}); >>>> + if (month!=this_month) div.className = "other"; >>>> + cell.day = day; cell.month = month; cell.year = iterator.getFullYear(); >>>> + if (vdc) { if (vdc(iterator.stripTime())) cell.removeClassName("disabled"); else cell.addClassName("disabled") }; >>>> + iterator.setDate( day + 1); >>>> + } >>>> + >>>> + if (this.today_cell) this.today_cell.removeClassName("today"); >>>> + >>>> + if ( $R( 0, 41 ).include(days_until = this.beginning_date.stripTime().daysDistance(today)) ) { >>>> + this.today_cell = this.calendar_day_grid[days_until]; >>>> + this.today_cell.addClassName("today"); >>>> + } >>>> + }, >>>> + refreshMonthYear: function() { >>>> + var m = this.date.getMonth(); >>>> + var y = this.date.getFullYear(); >>>> + // set the month >>>> + if (this.options.get("month_year") == "dropdowns") >>>> + { >>>> + this.month_select.setValue(m, false); >>>> + >>>> + var e = this.year_select.element; >>>> + if (this.flexibleYearRange() && (!(this.year_select.setValue(y, false)) || e.selectedIndex <= 1 || e.selectedIndex >= >>>> e.options.length - 2 )) this.populateYearRange(); >>>> + >>>> + this.year_select.setValue(y); >>>> + >>>> + } else { >>>> + this.month_year_label.update( Date.months[m] + " " + y.toString() ); >>>> + } >>>> + }, >>>> + populateYearRange: function() { >>>> + this.year_select.populate(this.yearRange().toArray()); >>>> + }, >>>> + yearRange: function() { >>>> + if (!this.flexibleYearRange()) >>>> + return $R(this.options.get("year_range")[0], this.options.get("year_range")[1]); >>>> + >>>> + var y = this.date.getFullYear(); >>>> + return $R(y - this.options.get("year_range"), y + this.options.get("year_range")); >>>> + }, >>>> + flexibleYearRange: function() { return (typeof(this.options.get("year_range")) == "number"); }, >>>> + validYear: function(year) { if (this.flexibleYearRange()) { return true;} else { return this.yearRange().include(year);} }, >>>> + dayHover: function(element) { >>>> + var hover_date = new Date(this.selected_date); >>>> + hover_date.setYear(element.year); hover_date.setMonth(element.month); hover_date.setDate(element.day); >>>> + this.updateFooter(hover_date.toFormattedString(this.use_time)); >>>> + }, >>>> + dayHoverOut: function(element) { this.updateFooter(); }, >>>> + clearSelectedClass: function() {if (this.selected_cell) this.selected_cell.removeClassName("selected");}, >>>> + setSelectedClass: function() { >>>> + if (!this.selection_made) return; >>>> + this.clearSelectedClass() >>>> + if ($R(0,42).include( days_until = this.beginning_date.stripTime().daysDistance(this.selected_date.stripTime()) )) { >>>> + this.selected_cell = this.calendar_day_grid[days_until]; >>>> + this.selected_cell.addClassName("selected"); >>>> + } >>>> + }, >>>> + reparse: function() { this.parseDate(); this.refresh(); }, >>>> + dateString: function() { >>>> + //mod for ofbiz Date input field, the return value will not be localized. >>>> + //return (this.selection_made) ? this.selected_date.toFormattedString(this.use_time) : " "; >>>> + return (this.selection_made) ? this.selected_date.toFormattedString_ofbiz_default(this.use_time) : " "; >>>> + }, >>>> + parseDate: function() >>>> + { >>>> + var value = $F(this.target_element).strip() >>>> + this.selection_made = (value != ""); >>>> + this.date = value=="" ? NaN : Date.parseFormattedString(this.options.get("date") || value); >>>> + if (isNaN(this.date)) this.date = new Date(); >>>> + if (!this.validYear(this.date.getFullYear())) this.date.setYear( (this.date.getFullYear() < this.yearRange().start) ? >>>> this.yearRange().start : this.yearRange().end); >>>> + this.selected_date = new Date(this.date); >>>> + this.use_time = /[0-9]:[0-9]{2}/.exec(value) ? true : false; >>>> + this.date.setDate(1); >>>> + }, >>>> + updateFooter:function(text) { if (!text) text = this.dateString(); this.footer_div.purgeChildren(); >>>> this.footer_div.build("span", {innerHTML: text }); }, >>>> + clearDate:function() { >>>> + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; >>>> + var last_value = this.target_element.value; >>>> + this.target_element.value = ""; >>>> + this.clearSelectedClass(); >>>> + this.updateFooter(' '); >>>> + if (last_value!=this.target_element.value) this.callback("onchange"); >>>> + }, >>>> + updateSelectedDate:function(partsOrElement, via_click) { >>>> + var parts = $H(partsOrElement); >>>> + if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false; >>>> + if (parts.get("day")) { >>>> + var t_selected_date = this.selected_date, vdc = this.options.get("valid_date_check"); >>>> + for (var x = 0; x<=3; x++) t_selected_date.setDate(parts.get("day")); >>>> + t_selected_date.setYear(parts.get("year")); >>>> + t_selected_date.setMonth(parts.get("month")); >>>> + >>>> + if (vdc && ! vdc(t_selected_date.stripTime())) { return false; } >>>> + this.selected_date = t_selected_date; >>>> + this.selection_made = true; >>>> + } >>>> + >>>> + if (!isNaN(parts.get("hour"))) this.selected_date.setHours(parts.get("hour")); >>>> + if (!isNaN(parts.get("minute"))) this.selected_date.setMinutes( Math.floor_to_interval(parts.get("minute"), >>>> this.options.get("minute_interval")) ); >>>> + if (parts.get("hour") === "" || parts.get("minute") === "") >>>> + this.setUseTime(false); >>>> + else if (!isNaN(parts.get("hour")) || !isNaN(parts.get("minute"))) >>>> + this.setUseTime(true); >>>> + >>>> + this.updateFooter(); >>>> + this.setSelectedClass(); >>>> + >>>> + if (this.selection_made) this.updateValue(); >>>> + if (this.closeOnClick()) { this.close(); } >>>> + if (via_click && !this.options.get("embedded")) { >>>> + if ((new Date() - this.last_click_at) < 333) this.close(); >>>> + this.last_click_at = new Date(); >>>> + } >>>> + }, >>>> + closeOnClick: function() { >>>> + if (this.options.get("embedded")) return false; >>>> + if (this.options.get("close_on_click")===nil ) >>>> + return (this.options.get("time")) ? false : true >>>> + else >>>> + return (this.options.get("close_on_click")) >>>> + }, >>>> + navMonth: function(month) { (target_date = new Date(this.date)).setMonth(month); return (this.navTo(target_date)); }, >>>> + navYear: function(year) { (target_date = new Date(this.date)).setYear(year); return (this.navTo(target_date)); }, >>>> + navTo: function(date) { >>>> + if (!this.validYear(date.getFullYear())) return false; >>>> + this.date = date; >>>> + this.date.setDate(1); >>>> + this.refresh(); >>>> + this.callback("after_navigate", this.date); >>>> + return true; >>>> + }, >>>> + setUseTime: function(turn_on) { >>>> + this.use_time = this.options.get("time") && (this.options.get("time")=="mixed" ? turn_on : true) // force use_time to true >>>> if time==true && time!="mixed" >>>> + if (this.use_time && this.selected_date) { // only set hour/minute if a date is already selected >>>> + var minute = Math.floor_to_interval(this.selected_date.getMinutes(), this.options.get("minute_interval")); >>>> + var hour = this.selected_date.getHours(); >>>> + >>>> + this.hour_select.setValue(hour); >>>> + this.minute_select.setValue(minute) >>>> + } else if (this.options.get("time")=="mixed") { >>>> + this.hour_select.setValue(""); this.minute_select.setValue(""); >>>> + } >>>> + }, >>>> + updateValue: function() { >>>> + var last_value = this.target_element.value; >>>> + this.target_element.value = this.dateString(); >>>> + if (last_value!=this.target_element.value) this.callback("onchange"); >>>> + }, >>>> + today: function(now) { >>>> + var d = new Date(); this.date = new Date(); >>>> + var o = $H({ day: d.getDate(), month: d.getMonth(), year: d.getFullYear(), hour: d.getHours(), minute: d.getMinutes()}); >>>> + if ( ! now ) o = o.merge({hour: "", minute:""}); >>>> + this.updateSelectedDate(o, true); >>>> + this.refresh(); >>>> + }, >>>> + close: function() { >>>> + if (this.closed) return false; >>>> + this.callback("before_close"); >>>> + this.target_element.calendar_date_select = nil; >>>> + Event.stopObserving(document, "mousedown", this.closeIfClickedOut_handler); >>>> + Event.stopObserving(document, "keypress", this.keyPress_handler); >>>> + this.calendar_div.remove(); this.closed = true; >>>> + if (this.iframe) this.iframe.remove(); >>>> + if (this.target_element.type != "hidden" && ! this.target_element.disabled) this.target_element.focus(); >>>> + this.callback("after_close"); >>>> + }, >>>> + closeIfClickedOut: function(e) { >>>> + if (! $(Event.element(e)).descendantOf(this.calendar_div) ) this.close(); >>>> + }, >>>> + keyPress: function(e) { >>>> + if (e.keyCode==Event.KEY_ESC) this.close(); >>>> + }, >>>> + callback: function(name, param) { if (this.options.get(name)) { this.options.get(name).bind(this.target_element)(param); } } >>>> +} >>>> + >>>> + >>>> +//OFBiz addition: functions to call the calendar >>>> +function call_cal(target, datetime) { >>>> + new CalendarDateSelect(target, {time:true,year_range:10} ); >>>> +} >>>> + >>>> +function call_cal_notime(target, datetime) { >>>> + new CalendarDateSelect(target, {time:false,year_range:10} ); >>>> +} >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/calendar_date_select.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,34 @@ >>>> +// American Format: 12/31/2000 5:00 pm >>>> +// Thanks, Wes Hays >>>> +Date.prototype.toFormattedString = function(include_time){ >>>> + str = Date.padded2(this.getMonth() + 1) + '/' +Date.padded2(this.getDate()) + '/' + this.getFullYear(); >>>> + >>>> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >>>> this.getAMPM() } >>>> + return str; >>>> +} >>>> + >>>> +Date.parseFormattedString = function (string) { >>>> + // Test these with and without the time >>>> + // 11/11/1111 12pm >>>> + // 11/11/1111 1pm >>>> + // 1/11/1111 10:10pm >>>> + // 11/1/1111 01pm >>>> + // 1/1/1111 01:11pm >>>> + // 1/1/1111 1:11pm >>>> + var regexp = "(([0-1]?[0-9])\/[0-3]?[0-9]\/[0-9]{4}) *([0-9]{1,2}(:[0-9]{2})? *(am|pm))?"; >>>> + var d = string.match(new RegExp(regexp, "i")); >>>> + if (d==null) { >>>> + return Date.parse(string); // Give javascript a chance to parse it. >>>> + } >>>> + >>>> + mdy = d[1].split('/'); >>>> + hrs = 0; >>>> + mts = 0; >>>> + if(d[3] != null) { >>>> + hrs = parseInt(d[3].split('')[0], 10); >>>> + if(d[5].toLowerCase() == 'pm') { hrs += 12; } // Add 12 more to hrs >>>> + mts = d[4].split(':')[1]; >>>> + } >>>> + + return new Date(mdy[2], parseInt(mdy[0], 10)-1, mdy[1], hrs, mts, 0); >>>> +} >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_american.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,27 @@ >>>> +// DB No Seconds Format: 2007-12-05 12:00 >>>> + >>>> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" >>>> + padded2; return padded2; } >>>> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >>>> 24 : hour ) } >>>> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >>>> + >>>> +Date.prototype.toFormattedString = function(include_time){ >>>> + str = this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + Date.padded2(this.getDate()); >>>> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } >>>> + return str; >>>> +} >>>> + >>>> +Date.parseFormattedString = function (string) { >>>> + var regexp = '([0-9]{4})-(([0-9]{1,2})-(([0-9]{1,2})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >>>> + var d = string.match(new RegExp(regexp, "i")); >>>> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >>>> + var offset = 0; >>>> + var date = new Date(d[1], 0, 1); >>>> + if (d[3]) { date.setMonth(d[3] - 1); } >>>> + if (d[5]) { date.setDate(d[5]); } >>>> + if (d[7]) { >>>> + date.setHours(parseInt(d[7], 10)); + } >>>> + if (d[8]) { date.setMinutes(d[8]); } >>>> + if (d[10]) { date.setSeconds(d[10]); } >>>> + return date; >>>> +} >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_db.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,12 @@ >>>> +// Time Format as "17:00" in DropDown Box >>>> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" >>>> + padded2; return padded2; } >>>> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >>>> 24 : hour ) } >>>> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >>>> + >>>> +// Formats date and time as "01 January 2000 17:00" >>>> +Date.prototype.toFormattedString = function(include_time) >>>> +{ >>>> + str = Date.padded2(this.getDate()) + " " + Date.months[this.getMonth()] + " " + this.getFullYear(); >>>> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >>>> + return str; >>>> +} >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,12 @@ >>>> +// Time Format as "17:00" in DropDown Box >>>> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" >>>> + padded2; return padded2; } >>>> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >>>> 24 : hour ) } >>>> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >>>> + >>>> +// Formats date and time as "2000.01.20 17:00" >>>> +Date.prototype.toFormattedString = function(include_time) >>>> +{ >>>> + str = this.getFullYear() + "." + Date.padded2(this.getMonth()+1) + "." + Date.padded2(this.getDate()); >>>> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >>>> + return str; >>>> +} >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_euro_24hr_ymd.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,33 @@ >>>> +// Time Format as "17:00" in DropDown Box >>>> +Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" >>>> + padded2; return padded2; } >>>> +Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - >>>> 24 : hour ) } >>>> +Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; } >>>> + >>>> +Date.prototype.toFormattedString = function(include_time){ >>>> + str = this.getDate() + "." + (this.getMonth() + 1) + "." + this.getFullYear(); >>>> + if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() } >>>> + return str; >>>> +} >>>> +Date.parseFormattedString = function (string) { >>>> + var regexp = '([0-9]{1,2})\.(([0-9]{1,2})\.(([0-9]{2,4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >>>> + var d = string.match(new RegExp(regexp, "i")); >>>> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >>>> + var offset = 0; >>>> + if (d[5] && d[5].length == 2) { >>>> + // we got only two digits for the year... >>>> + d[5] = Number(d[5]); >>>> + if (d[5] > 30) >>>> + d[5] += 1900; >>>> + else >>>> + d[5] += 2000; >>>> + } >>>> + var date = new Date(d[5], 0, 1); >>>> + if (d[3]) { date.setMonth(d[3] - 1); } >>>> + if (d[5]) { date.setDate(d[1]); } >>>> + if (d[7]) { >>>> + date.setHours(parseInt(d[7], 10)); >>>> + } >>>> + if (d[8]) { date.setMinutes(d[8]); } >>>> + if (d[10]) { date.setSeconds(d[10]); } >>>> + return date; >>>> +} >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_finnish.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,37 @@ >>>> +Date.prototype.toFormattedString = function(include_time){ >>>> + str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); + >>>> +if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + >>>> this.getAMPM() } >>>> +return str; >>>> +} >>>> + >>>> +Date.parseFormattedString = function (string) { >>>> + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + >>>> + "( ([0-9]{1,2}):([0-9]{2})? *(pm|am)" + >>>> + "?)?)?)?"; >>>> + var d = string.match(new RegExp(regexp, "i")); >>>> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >>>> + var offset = 0; >>>> + var date = new Date(d[1], 0, 1); >>>> + if (d[3]) { date.setMonth(d[3] - 1); } >>>> + if (d[5]) { date.setDate(d[5]); } >>>> + if (d[7]) { >>>> + hours = parseInt(d[7], 10); >>>> + offset=0; >>>> + if (d[9]) { >>>> + is_pm = (d[9].toLowerCase()=="pm"); >>>> + if (is_pm && hours <= 11) hours+=12; >>>> + if (!is_pm && hours == 12) hours=0; >>>> + } >>>> + date.setHours(hours); + } >>>> + if (d[8]) { date.setMinutes(d[8]); } >>>> + if (d[10]) { date.setSeconds(d[10]); } >>>> + if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); } >>>> + if (d[14]) { >>>> + offset = (Number(d[16]) * 60) + Number(d[17]); >>>> + offset *= ((d[15] == '-') ? 1 : -1); >>>> + } >>>> + >>>> + return date; >>>> +} >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_hyphen_ampm.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,46 @@ >>>> +Date.prototype.toFormattedString = function(include_time) { >>>> + var hour; >>>> + var str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate()); >>>> + if (include_time) { >>>> + hour = this.getHours(); >>>> + str += " " + this.getHours() + ":" + this.getPaddedMinutes(); >>>> + } >>>> + return str; >>>> +}; >>>> + >>>> +Date.parseFormattedString = function (string) { >>>> + >>>> + var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + + "( ([0-9]{1,2}):([0-9]{2})?" + >>>> + "?)?)?)?"; + >>>> + var d = string.match(new RegExp(regexp, "i")); >>>> + if (d === null) { >>>> + return Date.parse(string); // at least give javascript a crack at it. >>>> + } >>>> + var offset = 0; + var date = new Date(d[1], 0, 1); + if (d[3]) { >>>> + date.setMonth(d[3] - 1); >>>> + } + if (d[5]) { >>>> + date.setDate(d[5]); >>>> + } + if (d[7]) { >>>> + date.setHours(d[7]); >>>> + } + if (d[8]) { >>>> + date.setMinutes(d[8]); >>>> + } + if (d[0]) { >>>> + date.setSeconds(d[0]); >>>> + } + if (d[2]) { >>>> + date.setMilliseconds(Number("0." + d[2])); >>>> + } + if (d[4]) { >>>> + offset = (Number(d[6])) + Number(d[8]); >>>> + offset = ((d[5] == '-') ? 1 : -1); + } + return date; +}; >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_iso_date.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,24 @@ >>>> +// Italian Format: 31/12/2000 23:00 >>>> +// Thanks, Bigonazzi! >>>> + >>>> +Date.prototype.toFormattedString = function(include_time){ >>>> + str = this.getDate() + "/" + (this.getMonth() + 1) + "/" + this.getFullYear(); >>>> + if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() } >>>> + return str; >>>> +} >>>> + >>>> +Date.parseFormattedString = function (string) { >>>> + var regexp = '([0-9]{1,2})/(([0-9]{1,2})/(([0-9]{4})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?'; >>>> + var d = string.match(new RegExp(regexp, "i")); >>>> + if (d==null) return Date.parse(string); // at least give javascript a crack at it. >>>> + var offset = 0; >>>> + var date = new Date(d[5], 0, 1); >>>> + if (d[3]) { date.setMonth(d[3] - 1); } >>>> + if (d[5]) { date.setDate(d[1]); } >>>> + if (d[7]) { >>>> + date.setHours(parseInt(d[7], 10)); + } >>>> + if (d[8]) { date.setMinutes(d[8]); } >>>> + if (d[10]) { date.setSeconds(d[10]); } >>>> + return date; >>>> +} >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/format/format_italian.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,19 @@ >>>> +Date.weekdays = $w('Mo Di Mi Do Fr Sa So'); >>>> +Date.months = $w('Januar Februar März April Mai Juni Juli August September Oktober November Dezember'); >>>> + >>>> +Date.first_day_of_week = 1; >>>> + >>>> +_translations = { >>>> + "OK": "OK", >>>> + "Now": "Jetzt", >>>> + "Today": "Heute", >>>> + "Clear": "Löschen" >>>> +} >>>> + >>>> +//load the data format >>>> +var dataFormatJs = "format_euro_24hr.js" >>>> + >>>> +var e = document.createElement("script"); >>>> +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; >>>> +e.type="text/javascript"; >>>> +document.getElementsByTagName("head")[0].appendChild(e); >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/de.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,11 @@ >>>> +Date.weekdays = $w("L M X J V S D"); >>>> +Date.months = $w("Enero Febrero Marzo Abril Mayo Junio Julio Agosto Septiembre Octubre Noviembre Diciembre" ); >>>> + >>>> +Date.first_day_of_week = 1; >>>> + >>>> +_translations = { >>>> + "OK": "Cancelar", >>>> + "Now": "Ahora", >>>> + "Clear": "Limpiar", >>>> + "Today": "Hoy" >>>> +} >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/es.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,10 @@ >>>> +Date.weekdays = $w("Ma Ti Ke To Pe La Su"); >>>> +Date.months = $w("Tammikuu Helmikuu Maaliskuu Huhtikuu Toukokuu Kesäkuu Heinäkuu Elokuu Syyskuu Lokakuu Marraskuu Joulukuu" ); >>>> + >>>> +Date.first_day_of_week = 1 >>>> + >>>> +_translations = { >>>> + "OK": "OK", >>>> + "Now": "Nyt", >>>> + "Today": "Tänään" >>>> +} >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fi.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,19 @@ >>>> +Date.weekdays = $w('L Ma Me J V S D'); >>>> +Date.months = $w('Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre'); >>>> + >>>> +Date.first_day_of_week = 1; >>>> + >>>> +_translations = { >>>> + "OK": "OK", >>>> + "Now": "Maintenant", >>>> + "Today": "Aujourd'hui", >>>> + "Clear": "Effacer" >>>> +} >>>> + >>>> +//load the data format >>>> +var dataFormatJs = "format_euro_24hr.js" >>>> + >>>> +var e = document.createElement("script"); >>>> +e.src = "/images/calendarDateSelect/format/" + dataFormatJs; >>>> +e.type="text/javascript"; >>>> +document.getElementsByTagName("head")[0].appendChild(e); >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/fr.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,11 @@ >>>> +Date.weekdays = $w('Ma Di Wo Do Vr Za Zo'); >>>> +Date.months = $w('Januari Februari Maart April Mei Juni Juli Augustus September Oktober November December'); >>>> + >>>> +Date.first_day_of_week = 1; >>>> + >>>> +_translations = { >>>> + "OK": "OK", >>>> + "Now": "Nu", >>>> + "Today": "Vandaag", >>>> + "Clear": "Wissen" >>>> +} >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/nl.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,10 @@ >>>> +Date.weekdays = $w('P W Å C P S N'); >>>> +Date.months = $w('StyczeÅ Luty Marzec KwiecieÅ Maj Czerwiec Lipiec SierpieÅ WrzesieÅ Październik Listopad GrudzieÅ'); >>>> + >>>> +Date.first_day_of_week = 1 >>>> + >>>> +_translations = { >>>> + "OK": "OK", >>>> + "Now": "Teraz", >>>> + "Today": "DziÅ" >>>> +} >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pl.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,11 @@ >>>> +Date.weekdays = $w('D S T Q Q S S'); >>>> +Date.months = $w('Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro'); >>>> + >>>> +Date.first_day_of_week = 0 >>>> + >>>> +_translations = { >>>> + "OK": "OK", >>>> + "Now": "Agora", >>>> + "Today": "Hoje", >>>> + "Clear": "Limpar" >>>> +} >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/pt.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,10 @@ >>>> +Date.weekdays = $w('Ðн ÐÑ Ð¡Ñ Ð§Ñ ÐÑ Ð¡Ð± ÐÑ?'); >>>> +Date.months = $w('ЯнваÑÑ Ð¤ÐµÐ²ÑÐ°Ð»Ñ ÐаÑÑ Ð?пÑÐµÐ»Ñ Ðай ÐÑÐ½Ñ ÐÑÐ»Ñ Ð?вгÑÑ?Ñ Ð¡ÐµÐ½ÑÑ?бÑÑ >>>> ÐкÑÑ?бÑÑ Ð?оÑ?бÑÑ ÐекабÑÑ'); >>>> + >>>> +Date.first_day_of_week = 1 >>>> + >>>> +_translations = { >>>> + "OK": "OK", >>>> + "Now": "СейÑаÑ?", >>>> + "Today": "СегоднÑ?" >>>> +} >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/ru.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Added: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js?rev=886143&view=auto >>>> ============================================================================== >>>> --- ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js (added) >>>> +++ ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js Wed Dec 2 13:54:17 2009 >>>> @@ -0,0 +1,10 @@ >>>> +Date.weekdays = $w("? ? ? ? ? ? ?"); >>>> +Date.months = $w("? ? ? ? ? ? ? ? ? ? ?? ??" ); >>>> + >>>> +Date.first_day_of_week = 1 >>>> + >>>> +_translations = { >>>> + "OK": "??", >>>> + "Now": "??", >>>> + "Today": "??" >>>> +} >>>> \ No newline at end of file >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >>>> ------------------------------------------------------------------------------ >>>> svn:eol-style = native >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >>>> ------------------------------------------------------------------------------ >>>> svn:keywords = "Date Rev Author URL Id" >>>> >>>> Propchange: ofbiz/trunk/framework/images/webapp/images/calendarDateSelect/locale/zh.js >>>> ------------------------------------------------------------------------------ >>>> svn:mime-type = text/plain >>>> >>>> Modified: ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl?rev=886143&r1=886142&r2=886143&view=diff >>>> ============================================================================== >>>> --- ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl (original) >>>> +++ ofbiz/trunk/specialpurpose/cmssite/template/cms/HtmlHead.ftl Wed Dec 2 13:54:17 2009 >>>> @@ -26,8 +26,8 @@ >>>> <script language="javascript" src="/images/prototypejs/prototype.js" type="text/javascript"></script> >>>> <script language="javascript" src="/images/fieldlookup.js" type="text/javascript"></script> >>>> <script language="javascript" src="/images/selectall.js" type="text/javascript"></script> >>>> - <script language="javascript" src="/images/calendar_date_select.js" type="text/javascript"></script> >>>> - >>>> + <script language="javascript" src="/images/calendarDateSelect/calendar_date_select.js" type="text/javascript"></script> >>>> + <script language="javascript" >>>> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> <link rel="stylesheet" href="/images/ecommain.css" type="text/css"/> >>>> <link rel="stylesheet" href="/ecommerce/images/blog.css" type="text/css"/> >>>> <link rel="stylesheet" href="/content/images/contentForum.css" type="text/css"/> >>>> >>>> Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl?rev=886143&r1=886142&r2=886143&view=diff >>>> ============================================================================== >>>> --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl (original) >>>> +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/blog/main.ftl Wed Dec 2 13:54:17 2009 >>>> @@ -24,7 +24,8 @@ >>>> <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/prototype.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> - <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> + <script language="javascript" >>>> src="<@ofbizContentUrl>/images/calendarDateSelect/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script> >>>> + <script language="javascript" >>>> src="<@ofbizContentUrl>/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale!}.js</@ofbizContentUrl>" >>>> type="text/javascript"></script> >>>> <link rel='stylesheet' href='<@ofbizContentUrl>/images/maincss.css</@ofbizContentUrl>' type='text/css'> >>>> <link rel='stylesheet' href='<@ofbizContentUrl>/images/tabstyles.css</@ofbizContentUrl>' type='text/css'> >>>> <link rel='stylesheet' href='<@ofbizContentUrl>/ecommerce/images/blog.css</@ofbizContentUrl>' type='text/css'> >>>> >>>> Modified: ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml >>>> URL: >>>> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml?rev=886143&r1=886142&r2=886143&view=diff >>>> ============================================================================== >>>> --- ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml (original) >>>> +++ ofbiz/trunk/specialpurpose/ecommerce/widget/CommonScreens.xml Wed Dec 2 13:54:17 2009 >>>> @@ -41,7 +41,8 @@ >>>> <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> >>>> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >>>> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >>>> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >>>> global="true"/> >>>> + <set field="layoutSettings.javaScripts[+0]" >>>> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >>>> @@ -222,7 +223,7 @@ >>>> </widgets> >>>> </section> >>>> </screen> >>>> - + >>>> <screen name="CommonPopUpDecorator"> >>>> <section> >>>> <actions> >>>> @@ -244,7 +245,8 @@ >>>> <!-- NOTE: this should be included on each screen that uses it to avoid including it in all screens: --> >>>> <set field="layoutSettings.javaScripts[]" value="/images/fieldlookup.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[]" value="/images/selectall.js" global="true"/> >>>> - <set field="layoutSettings.javaScripts[]" value="/images/calendar_date_select.js" global="true"/> >>>> + <set field="layoutSettings.javaScripts[]" value="/images/calendarDateSelect/calendar_date_select.js" >>>> global="true"/> >>>> + <set field="layoutSettings.javaScripts[]" >>>> value="/images/calendarDateSelect/locale/${parameters.userLogin.lastLocale}.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/effects.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/validation.js" global="true"/> >>>> <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/> >>>> >>>> >>>> >>> >> >> > > |
Free forum by Nabble | Edit this page |