Skip to content

Instantly share code, notes, and snippets.

@facumartig
Last active December 20, 2015 00:39
Show Gist options
  • Save facumartig/6043497 to your computer and use it in GitHub Desktop.
Save facumartig/6043497 to your computer and use it in GitHub Desktop.
JS
for (i = 1; i <= days_number; i++) {
if (month == actual_m && diap == actual_d) {
tbody.append("<td id=\"2013-07-16 00:00:00\" class=\"actual\"><span><a href=\"#myModal\" role=\"button\" class=\"days\" data-toggle=\"modal\">" + diap + "</a></span></td>");
}
else {
tbody.append("<td id=\"2013-07-16 00:00:00\"><span><a href=\"#myModal\" role=\"button\" class=\"days\" data-toggle=\"modal\">" + diap + "</a></span></td>");
}
if (i % 7 === 0) tbody.append("</tr><tr>");
if (diap == days_number) break;
diap++;
}
$.ajax({
dataType: "json",
url: "./php/date2.php",
type: "POST",
data: { d: '2013/7/16' },
success: function() {
// success
}
});
$.getJSON('./php/date2.php', function (data) {
$.each(data, function(key, value){
$("<span class=\"badge badge-info\">" + value["id"] + "</span>").append($("#" + value["timestamp"]));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment