@tidepool/viz
Version:
Tidepool data visualization for diabetes device data.
880 lines (482 loc) • 23.8 kB
HTML
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>datetime · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.2">
<link rel="stylesheet" href="../../../gitbook/style.css">
<link rel="stylesheet" href="../../../gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../../../gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../../../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="format.html" />
<link rel="prev" href="bolus.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="../../../">
<a href="../../../">
Introduction
</a>
</li>
<li class="chapter " data-level="1.2" data-path="../../../docs/StartHere.html">
<a href="../../../docs/StartHere.html">
@tidepool/viz developer guide
</a>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="../../../docs/Background.html">
<a href="../../../docs/Background.html">
background
</a>
</li>
<li class="chapter " data-level="1.2.2" data-path="../../../docs/FeatureOverview.html">
<a href="../../../docs/FeatureOverview.html">
overview of features
</a>
</li>
<li class="chapter " data-level="1.2.3" data-path="../../../docs/Architecture.html">
<a href="../../../docs/Architecture.html">
planned architecture
</a>
</li>
<li class="chapter " data-level="1.2.4" data-path="../../../docs/DirectoryStructure.html">
<a href="../../../docs/DirectoryStructure.html">
app & directory structure
</a>
</li>
<li class="chapter " data-level="1.2.5" data-path="../../../docs/CodeStyle.html">
<a href="../../../docs/CodeStyle.html">
code style
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" data-path="../../../docs/views/">
<a href="../../../docs/views/">
per-view documentation
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="../../components/settings/">
<a href="../../components/settings/">
Device Settings view
</a>
</li>
<li class="chapter " data-level="1.3.2" data-path="../../../docs/views/Trends.html">
<a href="../../../docs/views/Trends.html">
Trends view
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" data-path="../../../docs/Storybook.html">
<a href="../../../docs/Storybook.html">
use of React Storybook
</a>
</li>
<li class="chapter " data-level="1.5" data-path="../../../docs/deps/">
<a href="../../../docs/deps/">
usage of dependencies
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="../../../docs/deps/D3.html">
<a href="../../../docs/deps/D3.html">
D3
</a>
</li>
<li class="chapter " data-level="1.5.2" data-path="../../../docs/deps/GSAP.html">
<a href="../../../docs/deps/GSAP.html">
GSAP
</a>
</li>
<li class="chapter " data-level="1.5.3" data-path="../../../docs/deps/Moment.html">
<a href="../../../docs/deps/Moment.html">
Moment
</a>
</li>
<li class="chapter " data-level="1.5.4" data-path="../../../docs/deps/React.html">
<a href="../../../docs/deps/React.html">
React
</a>
</li>
<li class="chapter " data-level="1.5.5" data-path="../../../docs/deps/ReactMotion.html">
<a href="../../../docs/deps/ReactMotion.html">
React Motion
</a>
</li>
<li class="chapter " data-level="1.5.6" data-path="../../../docs/deps/Redux.html">
<a href="../../../docs/deps/Redux.html">
Redux
</a>
</li>
<li class="chapter " data-level="1.5.7" data-path="../../../docs/deps/Webpack.html">
<a href="../../../docs/deps/Webpack.html">
webpack
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" data-path="../">
<a href="../">
utilities
</a>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="./">
<a href="./">
API docs for utilities
</a>
<ul class="articles">
<li class="chapter " data-level="1.6.1.1" data-path="basal.html">
<a href="basal.html">
basal
</a>
</li>
<li class="chapter " data-level="1.6.1.2" data-path="bloodglucose.html">
<a href="bloodglucose.html">
blood glucose
</a>
</li>
<li class="chapter " data-level="1.6.1.3" data-path="bolus.html">
<a href="bolus.html">
bolus
</a>
</li>
<li class="chapter active" data-level="1.6.1.4" data-path="datetime.html">
<a href="datetime.html">
datetime
</a>
</li>
<li class="chapter " data-level="1.6.1.5" data-path="format.html">
<a href="format.html">
format
</a>
</li>
<li class="chapter " data-level="1.6.1.6" data-path="misc.html">
<a href="misc.html">
misc
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="chapter " data-level="1.7" data-path="../../../docs/misc/">
<a href="../../../docs/misc/">
misc
</a>
<ul class="articles">
<li class="chapter " data-level="1.7.1" data-path="../../../docs/misc/CommonProps.html">
<a href="../../../docs/misc/CommonProps.html">
Common props
</a>
</li>
<li class="chapter " data-level="1.7.2" data-path="../../../docs/misc/Docs.html">
<a href="../../../docs/misc/Docs.html">
Docs setup & publishing
</a>
</li>
<li class="chapter " data-level="1.7.3" data-path="../../../docs/misc/TimeRenderingModes.html">
<a href="../../../docs/misc/TimeRenderingModes.html">
Time-rendering modes
</a>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../../.." >datetime</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<blockquote>
<p>@tidepool/viz@0.8.2-alpha apidocs /Users/clintbeacock/Sites/tidepool/viz
jsdoc2md "src/utils/datetime.js"</p>
</blockquote>
<h2 id="functions">Functions</h2>
<dl>
<dt><a href="#getTimezoneFromTimePrefs">getTimezoneFromTimePrefs(timePrefs)</a> ⇒ <code>String</code></dt>
<dd><p>getTimezoneFromTimePrefs</p>
</dd>
<dt><a href="#formatBirthdate">formatBirthdate(patient)</a> ⇒ <code>String</code></dt>
<dd><p>formatBirthdate</p>
</dd>
<dt><a href="#formatClocktimeFromMsPer24">formatClocktimeFromMsPer24(duration, [format])</a> ⇒ <code>String</code></dt>
<dd><p>formatClocktimeFromMsPer24</p>
</dd>
<dt><a href="#formatCurrentDate">formatCurrentDate()</a> ⇒ <code>String</code></dt>
<dd><p>formatCurrentDate</p>
</dd>
<dt><a href="#formatDiagnosisDate">formatDiagnosisDate(patient)</a> ⇒ <code>String</code></dt>
<dd><p>formatDiagnosisDate</p>
</dd>
<dt><a href="#formatDuration">formatDuration(duration)</a> ⇒ <code>String</code></dt>
<dd><p>formatDuration</p>
</dd>
<dt><a href="#formatLocalizedFromUTC">formatLocalizedFromUTC(utc, timePrefs, [format])</a> ⇒ <code>String</code></dt>
<dd><p>formatLocalizedFromUTC</p>
</dd>
<dt><a href="#getHammertimeFromDatumWithTimePrefs">getHammertimeFromDatumWithTimePrefs(datum, timePrefs)</a> ⇒ <code>Number</code></dt>
<dd><p>getHammertimeFromDatumWithTimePrefs</p>
</dd>
<dt><a href="#getLocalizedCeiling">getLocalizedCeiling(utc, timePrefs)</a> ⇒ <code>Object</code></dt>
<dd><p>getLocalizedCeiling</p>
</dd>
</dl>
<p><a name="getTimezoneFromTimePrefs"></a></p>
<h2 id="gettimezonefromtimeprefstimeprefs-⇒-string">getTimezoneFromTimePrefs(timePrefs) ⇒ <code>String</code></h2>
<p>getTimezoneFromTimePrefs</p>
<p><strong>Kind</strong>: global function<br><strong>Returns</strong>: <code>String</code> - timezoneName </p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>timePrefs</td>
<td><code>Object</code></td>
<td>object containing timezoneAware Boolean and timezoneName String</td>
</tr>
</tbody>
</table>
<p><a name="formatBirthdate"></a></p>
<h2 id="formatbirthdatepatient-⇒-string">formatBirthdate(patient) ⇒ <code>String</code></h2>
<p>formatBirthdate</p>
<p><strong>Kind</strong>: global function<br><strong>Returns</strong>: <code>String</code> - formatted birthdate, e.g., 'Jul 4, 1975'; empty String if none found </p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>patient</td>
<td><code>Object</code></td>
<td>Tidepool patient object containing profile</td>
</tr>
</tbody>
</table>
<p><a name="formatClocktimeFromMsPer24"></a></p>
<h2 id="formatclocktimefrommsper24duration-format-⇒-string">formatClocktimeFromMsPer24(duration, [format]) ⇒ <code>String</code></h2>
<p>formatClocktimeFromMsPer24</p>
<p><strong>Kind</strong>: global function<br><strong>Returns</strong>: <code>String</code> - formatted clocktime, e.g., '12:05 pm' </p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>duration</td>
<td><code>Number</code></td>
<td>positive integer representing a time of day in milliseconds within a 24-hr day</td>
</tr>
<tr>
<td>[format]</td>
<td><code>String</code></td>
<td>optional moment display format string; default is 'h:mm a'</td>
</tr>
</tbody>
</table>
<p><a name="formatCurrentDate"></a></p>
<h2 id="formatcurrentdate-⇒-string">formatCurrentDate() ⇒ <code>String</code></h2>
<p>formatCurrentDate</p>
<p><strong>Kind</strong>: global function<br><strong>Returns</strong>: <code>String</code> - formatted current date, e.g., 'Jul 4, 2017';<br><a name="formatDiagnosisDate"></a></p>
<h2 id="formatdiagnosisdatepatient-⇒-string">formatDiagnosisDate(patient) ⇒ <code>String</code></h2>
<p>formatDiagnosisDate</p>
<p><strong>Kind</strong>: global function<br><strong>Returns</strong>: <code>String</code> - formatted diagnosis date, e.g., 'Jul 4, 1975'; empty String if none found </p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>patient</td>
<td><code>Object</code></td>
<td>Tidepool patient object containing profile</td>
</tr>
</tbody>
</table>
<p><a name="formatDuration"></a></p>
<h2 id="formatdurationduration-⇒-string">formatDuration(duration) ⇒ <code>String</code></h2>
<p>formatDuration</p>
<p><strong>Kind</strong>: global function<br><strong>Returns</strong>: <code>String</code> - formatted duration, e.g., '1¼ hr' </p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>duration</td>
<td><code>Number</code></td>
<td>positive integer duration in milliseconds</td>
</tr>
</tbody>
</table>
<p><a name="formatLocalizedFromUTC"></a></p>
<h2 id="formatlocalizedfromutcutc-timeprefs-format-⇒-string">formatLocalizedFromUTC(utc, timePrefs, [format]) ⇒ <code>String</code></h2>
<p>formatLocalizedFromUTC</p>
<p><strong>Kind</strong>: global function<br><strong>Returns</strong>: <code>String</code> - formatted datetime, e.g., 'Sunday, January 1' </p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>utc</td>
<td><code>String</code></td>
<td>Zulu timestamp (Integer hammertime also OK)</td>
</tr>
<tr>
<td>timePrefs</td>
<td><code>Object</code></td>
<td>object containing timezoneAware Boolean and timezoneName String</td>
</tr>
<tr>
<td>[format]</td>
<td><code>String</code></td>
<td>optional moment display format string; default is 'dddd, MMMM D'</td>
</tr>
</tbody>
</table>
<p><a name="getHammertimeFromDatumWithTimePrefs"></a></p>
<h2 id="gethammertimefromdatumwithtimeprefsdatum-timeprefs-⇒-number">getHammertimeFromDatumWithTimePrefs(datum, timePrefs) ⇒ <code>Number</code></h2>
<p>getHammertimeFromDatumWithTimePrefs</p>
<p><strong>Kind</strong>: global function<br><strong>Returns</strong>: <code>Number</code> - Integer hammertime (i.e., UTC time in milliseconds) </p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>datum</td>
<td><code>Object</code></td>
<td>a Tidepool datum with a time (required) and deviceTime (optional)</td>
</tr>
<tr>
<td>timePrefs</td>
<td><code>Object</code></td>
<td>object containing timezoneAware Boolean and timezoneName String</td>
</tr>
</tbody>
</table>
<p><a name="getLocalizedCeiling"></a></p>
<h2 id="getlocalizedceilingutc-timeprefs-⇒-object">getLocalizedCeiling(utc, timePrefs) ⇒ <code>Object</code></h2>
<p>getLocalizedCeiling</p>
<p><strong>Kind</strong>: global function<br><strong>Returns</strong>: <code>Object</code> - a JavaScript Date, the closest (future) midnight according to timePrefs;
if utc is already local midnight, returns utc </p>
<table>
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>utc</td>
<td><code>String</code></td>
<td>Zulu timestamp (Integer hammertime also OK)</td>
</tr>
<tr>
<td>timePrefs</td>
<td><code>Object</code></td>
<td>object containing timezoneAware Boolean and timezoneName String</td>
</tr>
</tbody>
</table>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="bolus.html" class="navigation navigation-prev " aria-label="Previous page: bolus">
<i class="fa fa-angle-left"></i>
</a>
<a href="format.html" class="navigation navigation-next " aria-label="Next page: format">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"datetime","level":"1.6.1.4","depth":3,"next":{"title":"format","level":"1.6.1.5","depth":3,"path":"src/utils/apidocs/format.md","ref":"src/utils/apidocs/format.md","articles":[]},"previous":{"title":"bolus","level":"1.6.1.3","depth":3,"path":"src/utils/apidocs/bolus.md","ref":"src/utils/apidocs/bolus.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"src/utils/apidocs/datetime.md","mtime":"2017-05-31T14:39:43.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-05-31T15:26:30.892Z"},"basePath":"../../..","book":{"language":""}});
});
</script>
</div>
<script src="../../../gitbook/gitbook.js"></script>
<script src="../../../gitbook/theme.js"></script>
<script src="../../../gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="../../../gitbook/gitbook-plugin-search/search.js"></script>
<script src="../../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="../../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="../../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="../../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>