Created
January 26, 2017 09:08
-
-
Save aziz-blr/b8ba3e7d6af0bc64f76c651778c44433 to your computer and use it in GitHub Desktop.
Bootstrap Date/Time Picker - Change Formate On Change Event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- BOOTSTRAP DATE TIME PICKER --> | |
<script src="plugins/datetimepicker/bootstrap-datetimepicker.min.js"></script> | |
<script type="text/javascript"> | |
$(function () { | |
$('#meetingdatetime').datetimepicker({format: 'DD-MM-YYYY, h:m a'}).on('dp.change',function(e){ | |
var formatedValue = e.date.format("YYYY-MM-DD HH:mm:ss"); | |
$("#datetime").val(formatedValue); | |
}); | |
}); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$('#meetingdatetime').datepicker({ | |
format: 'dd/mm/yyyy', | |
autoclose: true | |
}).on('changeDate', function (e) { | |
var formatedValue = e.format("yyyy-mm-dd"); | |
$("#datetime").val(formatedValue); | |
}); // SET MYSQL DATE FORMATE IN HIDDEN FIELD | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment