Timestamp
Installation
Learn more about how to install on our getting started docs.
<script type="module">
  import '@rhds/elements/rh-timestamp/rh-timestamp.js';
</script>Import Map Example
<script type="importmap">
  {
    "imports": {
      "@rhds/elements/": "https://www.redhatstatic.com/dx/v1-alpha/@rhds/elements@2.0.1/elements/",
    }
  }
</script>npm install @rhds/elements<script type="module">
  import '@rhds/elements/rh-timestamp/rh-timestamp.js';
</script><script type="module">
  import '@rhds/elements/rh-timestamp/rh-timestamp.js';
</script>Import Map Example
<script type="importmap">
{
  "imports": {
    "@rhds/elements/rh-timestamp/rh-timestamp.js": "./elements/rh-timestamp/rh-timestamp.js"
  },
  "scopes": {
    "./": {
      "@patternfly/pfe-core/controllers/timestamp-controller.js": "https://ga.jspm.io/npm:@patternfly/pfe-core@4.0.2/controllers/timestamp-controller.js",
      "lit": "https://ga.jspm.io/npm:lit@3.2.0/index.js",
      "lit/decorators/": "https://ga.jspm.io/npm:lit@3.2.0/decorators/",
      "tslib": "https://ga.jspm.io/npm:tslib@2.7.0/tslib.es6.mjs"
    },
    "https://ga.jspm.io/": {
      "@lit/reactive-element": "https://ga.jspm.io/npm:@lit/reactive-element@2.0.4/development/reactive-element.js",
      "@lit/reactive-element/decorators/": "https://ga.jspm.io/npm:@lit/reactive-element@2.0.4/development/decorators/",
      "lit-element/lit-element.js": "https://ga.jspm.io/npm:lit-element@4.1.0/development/lit-element.js",
      "lit-html": "https://ga.jspm.io/npm:lit-html@3.2.0/development/lit-html.js",
      "lit-html/is-server.js": "https://ga.jspm.io/npm:lit-html@3.2.0/development/is-server.js",
      "tslib": "https://ga.jspm.io/npm:tslib@2.7.0/tslib.es6.mjs"
    }
  }
}
</script>Usage
<rh-timestamp></rh-timestamp>rh-timestamp
None
| Attribute | DOM Property | Description | Type | Default | 
|---|---|---|---|---|
| date-format | dateFormat | Custom date formatting style. See MDN for options. |  |  | 
| time-format | timeFormat | Custom time formatting style. See MDN for options. |  |  | 
| display-suffix | displaySuffix | Text to display after the timestamp |  |  | 
| locale | locale | Overrides the runtime's default locale |  |  | 
| relative | relative | Formats a timestamp in realtive terms |  |  | 
| utc | utc | Sets the timezone as UTC |  |  | 
| hour-12 | hour12 | Whether to use 12-hour time (as opposed to 24-hour time) |  |  | 
| date | date | A string value representing a date |  |  | 
None
None
None
None
None
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.