Created
April 7, 2016 08:52
-
-
Save anonymous/74c5cd7c1a9061728e5ff347236344e4 to your computer and use it in GitHub Desktop.
JS Bin [add your bin description] // source http://jsbin.com/maravu
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="[add your bin description]" /> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> | |
| function daysThisMonth() { | |
| var date = new Date(), | |
| y = date.getFullYear(), | |
| m = date.getMonth(), | |
| start = new Date(y, m, 1), | |
| end = new Date(y, m + 1, 1); | |
| return (end - start) / (1000 * 60 * 60 * 24); | |
| } | |
| function daysInMonth(y, m) { | |
| var start = new Date(y, m - 1, 1), | |
| end = new Date(y, m, 1); | |
| return (end - start) / (1000 * 60 * 60 * 24); | |
| } | |
| console.log(daysThisMonth()); | |
| console.log(daysInMonth(2016,4)); | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript"> | |
| function daysThisMonth() { | |
| var date = new Date(), | |
| y = date.getFullYear(), | |
| m = date.getMonth(), | |
| start = new Date(y, m, 1), | |
| end = new Date(y, m + 1, 1); | |
| return (end - start) / (1000 * 60 * 60 * 24); | |
| } | |
| function daysInMonth(y, m) { | |
| var start = new Date(y, m - 1, 1), | |
| end = new Date(y, m, 1); | |
| return (end - start) / (1000 * 60 * 60 * 24); | |
| } | |
| console.log(daysThisMonth()); | |
| console.log(daysInMonth(2016,4));</script></body> | |
| </html> |
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
| function daysThisMonth() { | |
| var date = new Date(), | |
| y = date.getFullYear(), | |
| m = date.getMonth(), | |
| start = new Date(y, m, 1), | |
| end = new Date(y, m + 1, 1); | |
| return (end - start) / (1000 * 60 * 60 * 24); | |
| } | |
| function daysInMonth(y, m) { | |
| var start = new Date(y, m - 1, 1), | |
| end = new Date(y, m, 1); | |
| return (end - start) / (1000 * 60 * 60 * 24); | |
| } | |
| console.log(daysThisMonth()); | |
| console.log(daysInMonth(2016,4)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment