Fix FormattedDate timezone bug (#681)

This commit is contained in:
InfiniteTF 2020-07-20 20:04:56 -07:00 committed by GitHub
parent c1be600b01
commit f4ae9b09a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View file

@ -36,7 +36,7 @@ const Version: React.FC<IVersionProps> = ({
<Icon icon={open ? "angle-up" : "angle-down"} className="mr-3" />
{version} (
{date ? (
<FormattedDate value={new Date(Date.parse(date))} />
<FormattedDate value={date} timeZone="utc" />
) : (
<FormattedMessage
defaultMessage="Development Version"

View file

@ -28,6 +28,9 @@ const markup = `
* Show rating as stars in scene page.
* Add reload scrapers button.
### 🐛 Bug fixes
* Fix formatted dates using incorrect timezone.
`;
export default () => <ReactMarkdown source={markup} />;

View file

@ -70,7 +70,11 @@ export const SceneDetailPanel: React.FC<ISceneDetailProps> = (props) => {
</div>
{props.scene.date ? (
<h5>
<FormattedDate value={props.scene.date} format="long" />
<FormattedDate
value={props.scene.date}
format="long"
timeZone="utc"
/>
</h5>
) : undefined}
{props.scene.rating ? (