Skip to content

Instantly share code, notes, and snippets.

View psynewave's full-sized avatar

Mark Flavin psynewave

View GitHub Profile
const getDaysBetweenDates = (dateStart, dateEnd) => (new Date(dateEnd) - new Date(dateStart)) / (1000 * 3600 * 24);
getDaysBetweenDates('1/21/2020', '1/21/2021'); // 366 leap year
getDaysBetweenDates('1/21/2019', '1/20/2020'); // 365
getDaysBetweenDates(new Date('08/04/2020'), new Date('08/24/2020'));
getDaysBetweenDates('08/04/2020','08/24/2020');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Market Explorer Embed</title>
<style>
html,body{height:100%;margin:0;padding:0;}
#pageContainer{display:flex;flex-direction:column;height:100%;}
#iframeWrapper{flex:1;min-height:0;position:relative;}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Rick Smith – Market Explorer</title>
<style>
/* reset & layout */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: –apple-system, BlinkMacSystemFont, sans-serif; }