Dialog with Date Picker
How do I make an dialog with date picker?
Test running a date picker in a modal dialog.. What is a dialog with date picker? How do you make a dialog with date picker? This script and codes were developed by Michael E Conroy on 03 July 2022, Sunday.
Dialog with Date Picker - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Dialog with Date Picker</title> <link rel='stylesheet prefetch' href='http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='http://cdn.rawgit.com/m-e-conroy/angular-dialog-service/v4.2.0/dialogs.min.css'>
</head>
<body> <div class="container" ng-app="modalTest" ng-controller="dialogTestCtrl"> <div class="row"> <div class="col-md-12"> <h1>Dialog Custom Service with Date Picker Demo</h1> <p>Testing whether another directive in a custom dialog works properly. In this demo we'll use the Date Picker directive that comes with Angular-UI-Bootstrap.</p> </div> </div> <div class="row"> <div class="col-md-12"> <button class="btn btn-primary" ng-click="launch()">Launch Custom Dialog</button> </div> </div> <div class="row"> <div class="col-md-12"> <br/> <p>Date Picked: <span class="text-info">{{data.dt | date:'fullDate' }}</span></p> </div> </div>
</div> <script src='http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js'></script>
<script src='http://code.angularjs.org/1.2.16/angular.min.js'></script>
<script src='http://code.angularjs.org/1.2.16/angular-sanitize.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/bower-angular-translate/2.0.1/angular-translate.min.js'></script>
<script src='http://rawgithub.com/m-e-conroy/angular-dialog-service/v4.2.0/example/js/ui-bootstrap-tpls-0.11.0.min.js'></script>
<script src='http://rawgithub.com/m-e-conroy/angular-dialog-service/v4.2.0/dialogs.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Dialog with Date Picker - Script Codes JS Codes
angular.module('modalTest',['ui.bootstrap','dialogs.main']) .controller('dialogTestCtrl',function($scope,dialogs){ //== Variables ==// $scope.data = { dt: new Date() }; //== Methods ==// $scope.launch = function(){ var dlg = dialogs.create('/dialogs/custom.html','customDialogCtrl',$scope.data); dlg.result.then(function(data){ $scope.data = data; }); }; // end launch }) // end dialogTest .controller('customDialogCtrl',function($log,$scope,$modalInstance,data){ $scope.data = data; $scope.opened = false; //== Listeners ==// $scope.$watch('data.dt',function(val,old){ $log.info('Date Changed: ' + val); $scope.opened = false; }); //== Methods ==// $scope.setDate = function(){ if(!angular.isDefined($scope.data.dt)) $scope.data.dt = new Date(); // today }; $scope.setDate(); $scope.open = function($event){ $event.preventDefault(); $event.stopPropagation(); $scope.opened = true; }; // end open $scope.done = function(){ $modalInstance.close($scope.data); }; // end done }) // end customDialogCtrl .config(function(dialogsProvider){ // this provider is only available in the 4.0.0+ versions of angular-dialog-service dialogsProvider.useBackdrop(true); dialogsProvider.useEscClose(true); dialogsProvider.useCopy(false); dialogsProvider.setSize('sm'); }) // end config .run(function($templateCache){ $templateCache.put('/dialogs/custom.html','<div class="modal-header"><h4 class="modal-title">Date Picker Test</h4></div><div class="modal-body"><p class="input-group"><input type="text" class="form-control" datepicker-popup="dd-MMMM-yyyy" ng-model="data.dt" datepicker-mode="year" is-open="opened" show-button-bar="false" /><span class="input-group-btn"><button class="btn btn-default" ng-click="open($event)"><span class="glyphicon glyphicon-calendar"></span></button></span></p></div><div class="modal-footer"><button class="btn btn-default" ng-click="done()">Done</button></div>'); }); // end run
Developer | Michael E Conroy |
Username | m-e-conroy |
Uploaded | July 03, 2022 |
Rating | 4 |
Size | 2,700 Kb |
Views | 48,576 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
AngularJS Floating Menu | 4,071 Kb |
AngularJS Datalist Directive | 2,366 Kb |
Button with animated timer | 2,931 Kb |
AngularJS Droppable Directive With Dynamic Template | 3,748 Kb |
AngularJS Dialog Service, with i18n | 5,197 Kb |
AngularJS BootStrap 3 Modal Dialogs | 3,848 Kb |
Course Layout in Angular Material | 16,237 Kb |
AngularJS Draggable Directive | 3,506 Kb |
AngularJS Windows | 4,665 Kb |
Dragging in AngularJS | 2,859 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Count up | Alanshortis | 2,391 Kb |
IE flex collapse bug fix | Rowno | 2,678 Kb |
3d css cube | Semenchenko | 4,578 Kb |
CSS3 Butterfly | Timohausmann | 3,430 Kb |
Custom Select Element | Agrayson | 3,616 Kb |
JavaScript constructors | Simboonlong | 2,415 Kb |
E-mail Template | SoloMDFK | 4,871 Kb |
Countdown Timer | Massiebn | 3,001 Kb |
Tile Animation Thing | Frxnz | 4,332 Kb |
Dribbble Template | ExtremelyGinger | 2,204 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!