Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Feat/expire on locale (#65)
Browse files Browse the repository at this point in the history
* fix: use browser local timezonr

* bump version

* fix: wrong place

* fix: display correct timezone

Co-authored-by: cgi-bin <[email protected]>
  • Loading branch information
sven-hash and cgi-bin authored Jan 25, 2023
1 parent 1232ea1 commit 7132932
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/UserInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ class UserInput extends React.Component {
!event.target.checked,
burnChecked: false,
isPrivate: true,
expirationChecked: false
})
}}
size="sm"
Expand Down
9 changes: 2 additions & 7 deletions src/components/TextStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,10 @@ class TextStats extends React.Component {
>
{this.props.expiration_time
? '- Expire on: ' +
new Date(this.props.expiration_time).toLocaleString(
navigator.language
)
new Date(this.props.expiration_time).toLocaleString(navigator.language,{timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone})
: ''}
</Typography>


{this.props.expiration_height ? <>&nbsp;</> : ''}
<Typography
level="body2"
Expand All @@ -69,9 +66,7 @@ class TextStats extends React.Component {
>
{this.props.expiration_height
? '- Expire block height: ' +
new Date(this.props.expiration_height).toLocaleString(
navigator.language,{timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone}
)
this.props.expiration_height
: ''}
</Typography>

Expand Down

0 comments on commit 7132932

Please sign in to comment.