Published
Edited
Mar 14, 2021
4 stars
Insert cell
Insert cell
Insert cell
{
let display = soft(place)
if(!display || display.length===0){
return html`<div><div class="huge"> - </div> <div class="small"></div></div>`
}
// get the current time there
let s = spacetime.now(display.iana)
let abbrev = display[0].standard.abbrev
let zone = display[0].standard.name

//if it's daylight-savings, use that zone
if(display.daylight && s.isDST()){
abbrev = display.daylight.abbrev
zone = display.daylight.name
}
//render the formatted-time
let time = `${s.time()} ${abbrev}`
return html`<div>
<div class="huge">${time}</div>
<div class="small">${zone}</div>
</div>`

}
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more