Commit e5fec110 authored by Evren Kutar's avatar Evren Kutar

datepicker has resolved for all forms

parent bf450bf8
...@@ -24,7 +24,7 @@ var app = angular.module( ...@@ -24,7 +24,7 @@ var app = angular.module(
//'ulakbus.version', //'ulakbus.version',
'schemaForm', 'schemaForm',
'gettext', 'gettext',
//'templates-prod' 'templates-prod'
]). ]).
/** /**
* RESTURL is the url of rest api to talk * RESTURL is the url of rest api to talk
...@@ -32,6 +32,7 @@ var app = angular.module( ...@@ -32,6 +32,7 @@ var app = angular.module(
*/ */
constant("RESTURL", (function () { constant("RESTURL", (function () {
return {url: "http://" + window.location.hostname + ":9001/"}; return {url: "http://" + window.location.hostname + ":9001/"};
//return {url: "http://api.ulakbus.net/"};
})()). })()).
/** /**
* USER_ROLES and AUTH_EVENTS are constant for auth functions * USER_ROLES and AUTH_EVENTS are constant for auth functions
......
...@@ -28,23 +28,15 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout, ...@@ -28,23 +28,15 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout,
angular.forEach(scope.schema.properties, function (k, v) { angular.forEach(scope.schema.properties, function (k, v) {
// check if type is date and if type date found change it to string // check if type is date and if type date found change it to string
// and give it 'type':'template' property and load it with template
if (k.type == 'date') { if (k.type == 'date') {
k.title = k.title; k.type = 'string';
scope.form[scope.form.indexOf(v)] = {
"type": "template",
"templateUrl": "shared/templates/datefield.html",
"title": k.title,
"key": k.name
};
debugger;
scope.model[k.name] = generator.dateformatter(scope.model[k.name]);
// seek for datepicker field and initialize datepicker //// seek for datepicker field and initialize datepicker
scope.$watch(angular.element($('.datepickerfield')), function(){ scope.$watch($('#'+v), function(){
console.log('date field initialized'); $timeout(function () {
$('.datepickerfield').datepicker(); jQuery('#' + v).datepicker();
});
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment