--- /dev/null
+(function(angular, $, _) {
+
+ angular.module('crmExample', [
+ 'crmUtil', 'ngRoute', 'ui.utils', 'crmUi'
+ ]);
+
+ angular.module('crmExample').config([
+ '$routeProvider',
+ function($routeProvider) {
+ $routeProvider.when('/example', {
+ templateUrl: '~/crmExample/example.html',
+ controller: 'ExampleCtrl'
+ });
+ }
+ ]);
+
+ angular.module('crmExample').controller('ExampleCtrl', function ExampleCtrl($scope) {
+ $scope.ts = CRM.ts(null);
+
+ //$scope.examples = {
+ // blank1: {value: '', required: false},
+ // blank2: {value: '', required: true},
+ // filled1: {value:'2014-01-02', required: false},
+ // filled2: {value:'2014-02-03', required: true}
+ //};
+
+ //$scope.examples = {
+ // blank1: {value: '', required: false},
+ // blank2: {value: '', required: true},
+ // filled1: {value:'12:34', required: false},
+ // filled2: {value:'10:09', required: true}
+ //};
+
+ $scope.examples = {
+ blank: {value: '', required: false},
+ //blankReq: {value: '', required: true},
+ filled: {value:'2014-01-02 03:04', required: false},
+ //filledReq: {value:'2014-02-03 05:06', required: true},
+ missingDate: {value:' 05:06', required: false},
+ //missingDateReq: {value:' 05:06', required: true},
+ missingTime: {value:'2014-03-04 ', required: false}
+ //missingTimeReq: {value:'2014-03-04 ', required: true}
+ };
+
+ });
+
+})(angular, CRM.$, CRM._);
--- /dev/null
+<form name="exampleForm" novalidate>
+ <table>
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Value</th>
+ <th>Input</th>
+ <th>ngModel</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+ <tr ng-repeat="(exName, example) in examples">
+ <td>{{exName}}</td>
+ <td>{{example.value}}</td>
+ <td>
+ <!--<input crm-ui-date ng-model="example.value" name="{{exName}}" ng-required="example.required"/> -->
+ <!--<input crm-ui-time ng-model="example.value" name="{{exName}}" ng-required="example.required"/> -->
+ <!-- <div crm-ui-date-time ng-model="example.value" name="{{exName}}" ng-required="example.required"/> -->
+ <div class="crmMailing-schedule-outer" crm-mailing-radio-date="schedule" ng-model="example.value"
+ name="{{exName}}">
+
+ <div class="crmMailing-schedule-inner">
+ <div>
+ <input ng-model="schedule.mode" type="radio" name="send_{{exName}}" value="now" id="schedule-send-now"/>
+ <label for="schedule-send-now">{{ts('Send immediately')}}</label>
+ </div>
+ <div>
+ <input ng-model="schedule.mode" type="radio" name="send_{{exName}}" value="at" id="schedule-send-at"/>
+ <label for="schedule-send-at">{{ts('Send at:')}}</label>
+ <span crm-ui-date-time ng-model="schedule.datetime" ng-required="schedule.mode == 'at'"></span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ <td>
+ <pre>{{exampleForm[exName]|json}}</pre>
+ </td>
+ </tr>
+
+ </tbody>
+ </table>
+
+</form>