Skip to content

PTBC8 Zachary Lim - World Clock#53

Open
zacharylz wants to merge 1 commit intorocketacademy:mainfrom
zacharylz:main
Open

PTBC8 Zachary Lim - World Clock#53
zacharylz wants to merge 1 commit intorocketacademy:mainfrom
zacharylz:main

Conversation

@zacharylz
Copy link
Copy Markdown

World clock submission


return (
<div>
{clockData.map((timezoneValue, i) => <Clock timeZone={timezoneValue} key={i}/> )}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOVE this, so far you are the only one who has used .map to render the different clocks, great job mate


return (
<div>
<h2>Current Time: {this.state.time.toLocaleString('en-GB', {timeZone: (timeZone ? timeZone : undefined)})} ({(timeZone ? timeZone : "Local")})</h2>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for timeZone ? timeZone : undefined, maybe something like timeZone || undefined will suffice

|| = OR (reference)

Similar to a &&, || will be triggered if there is NO timezone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants