index.html 2.26 KB
<!doctype html>
<!--
@license
Copyright (c) 2015 Abdón Rodríguez Davila (@abdonrd). All rights reserved.
This code may only be used under the MIT license.
-->
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
    <title>momentjs-element demo</title>

    <script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>

    <link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html">
    <link rel="import" href="../../iron-demo-helpers/demo-snippet.html">
    <link rel="import" href="../moment-element.html">

    <style is="custom-style" include="demo-pages-shared-styles">
      .vertical-section-container {
        max-width: 550px;
      }

      moment-element {
        display: block;
      }
    </style>
  </head>
  <body unresolved>
    <div class="vertical-section-container centered">
      <h3>Current date and date from string (ISO 8601 and another)</h3>
      <demo-snippet>
        <template>
          <moment-element></moment-element>
          <moment-element datetime="1991-12-31"></moment-element>
          <moment-element datetime="12-31-1991" input-format="MM-DD-YYYY"></moment-element>
        </template>
      </demo-snippet>

      <h3>Date from string + format</h3>
      <demo-snippet>
        <template>
          <moment-element datetime="1991-12-31" output-format="l"></moment-element>
          <moment-element datetime="12-31-1991" input-format="MM-DD-YYYY" output-format="l"></moment-element>
          <moment-element datetime="1991-12-31" output-format="MMM DD[,] YYYY"></moment-element>
        </template>
      </demo-snippet>

      <h3>Date from now or from custom date</h3>
      <demo-snippet>
        <template>
          <moment-element datetime="1991-12-31" from="now"></moment-element>
          <moment-element datetime="1991-12-31" from="2003-06-23"></moment-element>
        </template>
      </demo-snippet>

      <h3>Date to now or to custom date</h3>
      <demo-snippet>
        <template>
          <moment-element datetime="1991-12-31" to="now"></moment-element>
          <moment-element datetime="1991-12-31" to="2003-06-23"></moment-element>
        </template>
      </demo-snippet>
    </div>
  </body>
</html>