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
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" /> <Icon icon={open ? "angle-up" : "angle-down"} className="mr-3" />
{version} ( {version} (
{date ? ( {date ? (
<FormattedDate value={new Date(Date.parse(date))} /> <FormattedDate value={date} timeZone="utc" />
) : ( ) : (
<FormattedMessage <FormattedMessage
defaultMessage="Development Version" defaultMessage="Development Version"

View File

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

View File

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