Skip to content

Instantly share code, notes, and snippets.

@LESTADru
Created February 6, 2014 18:14
Show Gist options
  • Save LESTADru/8849549 to your computer and use it in GitHub Desktop.
Save LESTADru/8849549 to your computer and use it in GitHub Desktop.
функцию getLastDayInMonth(year, month), которая возвращает последний день месяца.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> функцию getLastDayInMonth(year, month),
которая возвращает последний день месяца.</title>use soft Wraps
</head>
<body>
<script>
"use strict";
function getLastDayInMonth(year, month){
var date = new Date(year, month+1, 0);
return date.getDate();
}
alert(getLastDayInMonth(2012, 2));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment