Commit 5300be68 authored by Evren Kutar's avatar Evren Kutar

datepicker has resolved for all forms

parent 3dc0b101
......@@ -24,7 +24,7 @@ var app = angular.module(
//'ulakbus.version',
'schemaForm',
'gettext',
//'templates-prod'
'templates-prod'
]).
/**
* RESTURL is the url of rest api to talk
......@@ -32,6 +32,7 @@ var app = angular.module(
*/
constant("RESTURL", (function () {
return {url: "http://" + window.location.hostname + ":9001/"};
//return {url: "http://api.ulakbus.net/"};
})()).
/**
* USER_ROLES and AUTH_EVENTS are constant for auth functions
......
......@@ -28,23 +28,15 @@ form_generator.factory('Generator', function ($http, $q, $log, $modal, $timeout,
angular.forEach(scope.schema.properties, function (k, v) {
// 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') {
k.title = k.title;
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]);
k.type = 'string';
// seek for datepicker field and initialize datepicker
scope.$watch(angular.element($('.datepickerfield')), function(){
console.log('date field initialized');
$('.datepickerfield').datepicker();
//// seek for datepicker field and initialize datepicker
scope.$watch($('#'+v), function(){
$timeout(function () {
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