[ADD] Plugged datetimepicker on datetime widget

bzr revid: fme@openerp.com-20110405095549-b5k2xrnveod93ioi
This commit is contained in:
Fabien Meghazi 2011-04-05 11:55:49 +02:00
parent c08686a3b8
commit bf9eb36d07
3 changed files with 26 additions and 2 deletions

View File

@ -10,6 +10,7 @@
<script type="text/javascript" src="/base/static/lib/qweb/qweb.js"></script>
<script type="text/javascript" src="/base/static/lib/jquery/jquery-1.5.1.js"></script>
<script type="text/javascript" src="/base/static/lib/jquery.ui/js/jquery-ui-1.8.9.custom.min.js"></script>
<script type="text/javascript" src="/base/static/lib/jquery.ui/js/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="/base/static/lib/jquery.jqGrid/jquery.jqGrid.js"></script>
<script type="text/javascript" src="/base/static/lib/jquery.superfish/js/hoverIntent.js"></script>
<script type="text/javascript" src="/base/static/lib/jquery.superfish/js/superfish.js"></script>

View File

@ -422,7 +422,7 @@ body.openerp {
border-radius: 3px;
background: white;
}
.openerp input.field_date {
.openerp input.field_date, .openerp input.field_datetime {
background: url('../img/ui/field_calendar.png') no-repeat right center;
background-origin: content-box;
-moz-background-origin: content;

View File

@ -492,7 +492,16 @@ openerp.base.form.FieldDate = openerp.base.form.FieldChar.extend({
},
start: function() {
this._super.apply(this, arguments);
this.$element.find('input').datepicker();
this.$element.find('input').datepicker({
dateFormat: 'yy-mm-dd'
});
},
set_value: function(value) {
this._super.apply(this, arguments);
var show_value = (value != null && value !== false) ? value : '';
this.$element.find('input').val(show_value);
},
get_value: function() {
}
});
@ -500,6 +509,20 @@ openerp.base.form.FieldDatetime = openerp.base.form.FieldChar.extend({
init: function(view, node) {
this._super(view, node);
this.template = "FieldDatetime";
},
start: function() {
this._super.apply(this, arguments);
this.$element.find('input').datetimepicker({
dateFormat: 'yy-mm-dd',
timeFormat: 'hh:mm:ss'
});
},
set_value: function(value) {
this._super.apply(this, arguments);
var show_value = (value != null && value !== false) ? value : '';
this.$element.find('input').val(show_value);
},
get_value: function() {
}
});