Display div content in Sweet Alert

hi everyone,

i want to display content of div into sweet alert message and here is my code

<?php 

echo '<script>
var swal2container = $("#swal2container").text();

setTimeout(function() {
swal({
title: "Alert!",
text: swal2container,
type: "error"
}, function() {
window.location = "index.php";
});
}, 100);




</script>';


?>

<div id="swal2container">test</div> 

i still cant get the content of swal2container when sweet alert . Anyone can help meh?

how to disable today date on datepicker that follow the time zone.

Hi everythings,

I have a question regarding on disabling today date on datepicker, i got this code from internet and it seem like working , but then i realised its starting disable today date from 08:00 am onward and not disable from 12:00 am, seems like its has problem with time zone, i guess.

$('.datepicker').datepicker({
format: 'dd-mm-yyyy', 
startDate: '+1d',
endDate: '+5m',                              
beforeShowDay: renderCalendarCallback               
});

Does anyone can explain me why this thing happen? TQ in advance.