Skip to content

Instantly share code, notes, and snippets.

@russo97
Last active February 3, 2022 13:21
Show Gist options
  • Save russo97/5edc74588e05153a1637dbee97b9b720 to your computer and use it in GitHub Desktop.
Save russo97/5edc74588e05153a1637dbee97b9b720 to your computer and use it in GitHub Desktop.
Date Picker
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datepicker/1.0.10/datepicker.css" integrity="sha512-n/98Hzv7vnNVN8bL5s+hajql1X8LVhS/kPJIMxpXinGzcIVcM+SKTG54IKnRVz8vPIJmWWtyRyP3p4aK3vLiZw==" crossorigin="anonymous" referrerpolicy="no-referrer">
<script src="https://cdnjs.cloudflare.com/ajax/libs/datepicker/1.0.10/datepicker.min.js" integrity="sha512-RCgrAvvoLpP7KVgTkTctrUdv7C6t7Un3p1iaoPr1++3pybCyCsCZZN7QEHMZTcJTmcJ7jzexTO+eFpHk4OCFAg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/datepicker/1.0.10/i18n/datepicker.pt-BR.min.js" integrity="sha512-ecglO5oibZlGXLfdIbAuHLD7QIM3DOB2eCDrMOIpcP+V05KNWHv+6DmwDkw43N3noRS/0k37wOhCS0WlGz82Ow==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript">
$('#rd-text_field-kyvprveb').datepicker({
autoclose: true,
language: 'pt-BR',
format: 'DD/MM/YYYY',
});
$('#rd-text_field-kyvprvea').datepicker({
autoclose: true,
language: 'pt-BR',
startDate: '01/04/2022'
}).on('pick.datepicker', function (selected) {
const date = new Date(selected.date);
$('#rd-text_field-kyvprveb').datepicker('setStartDate', date);
$('#rd-text_field-kyvprveb').datepicker('setDate', date);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment