Skip to content

Commit

Permalink
Use <time> for example Clock component
Browse files Browse the repository at this point in the history
Just because [there’s an element for that](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time).
  • Loading branch information
tigt authored and marvinhagemeister committed Jun 29, 2018
1 parent 9f7d6ec commit 969f56f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -251,8 +251,8 @@ import { h, render, Component } from 'preact';

class Clock extends Component {
render() {
let time = new Date().toLocaleTimeString();
return <span>{ time }</span>;
let time = new Date();
return <time datetime={time.toISOString()}>{ time.toLocaleTimeString() }</time>;
}
}

Expand Down

0 comments on commit 969f56f

Please sign in to comment.