source: Dev/branches/rest-dojo-ui/client/rft/ui/generic/DateTimeTextBox.js @ 415

Last change on this file since 415 was 415, checked in by hendrikvanantwerpen, 12 years ago

Support data validation and increase dendency separation.

Added json-schema validation before documents are saved. Acts both as
a safe-guard and as a reference of the data model.

Added directory for server related material. For now it contains scripts
to configure CouchDB and check validity of documents against the schema.

Started separating out parts that depend on the data model from parts
that do not.

File size: 786 bytes
Line 
1define([
2    'dojo/_base/declare',
3    'dojo/on',
4    'dijit/_WidgetBase',
5    'dijit/_TemplatedMixin',
6    'dijit/_WidgetsInTemplateMixin',
7    'dojo/text!./templates/DateTimeTextBox.html'
8],function(declare,on,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,template){
9    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin],{
10        templateString: template,
11        baseClass: "rftDateTimeTextBox",
12        _getValueAttr: function() {
13            var date = this.dateBox.get('value').getTime();
14            var time = this.timeBox.get('value').getTime();
15            return new Date(date+time);
16        },
17        _setValueAttr: function(value) {
18            this.dateBox.set('value',value);
19            this.timeBox.set('value',value);
20        }
21    });
22});
Note: See TracBrowser for help on using the repository browser.