ConditionAttrDateView.js revision 89092dc10fe08b037266c0b4efb94b221f6fffb3
1N/A/**
1N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
1N/A *
1N/A * Copyright 2015 ForgeRock AS.
1N/A *
1N/A * The contents of this file are subject to the terms
1N/A * of the Common Development and Distribution License
1N/A * (the License). You may not use this file except in
1N/A * compliance with the License.
1N/A *
1N/A * You can obtain a copy of the License at
1N/A * http://forgerock.org/license/CDDLv1.0.html
1N/A * See the License for the specific language governing
1N/A * permission and limitations under the License.
1N/A *
1N/A * When distributing Covered Code, include this CDDL
1N/A * Header Notice in each file and include the License file
1N/A * at http://forgerock.org/license/CDDLv1.0.html
1N/A * If applicable, add the following below the CDDL Header,
1N/A * with the fields enclosed by brackets [] replaced by
1N/A * your own identifying information:
1N/A * "Portions Copyrighted [year] [name of copyright owner]"
1N/A */
1N/A
1N/A/*global window, define, $, _ */
1N/A
1N/Adefine("org/forgerock/openam/ui/policy/policies/conditions/ConditionAttrDateView", [
1N/A "org/forgerock/openam/ui/policy/policies/conditions/ConditionAttrBaseView"
1N/A], function (ConditionAttrBaseView) {
1N/A var ConditionAttrDateView = ConditionAttrBaseView.extend({
1N/A template: 'templates/policy/policies/conditions/ConditionAttrDate.html',
1N/A
render: function (data, element, callback) {
this.initBasic(data, element, 'pull-left attr-group');
this.parentRender(function () {
this.initDatePickers();
if (callback) {
callback();
}
});
},
initDatePickers: function () {
var common = {numberOfMonths: 2, dateFormat: 'yy:mm:dd'};
this.$el.find("#startDate").datepicker(
$.extend({onClose: function (selectedDate) {
$("#endDate").datepicker("option", "minDate", selectedDate);
}}, common)
);
this.$el.find("#endDate").datepicker(
$.extend({onClose: function (selectedDate) {
$("#startDate").datepicker("option", "maxDate", selectedDate);
}}, common)
);
}
});
return ConditionAttrDateView;
});