Convert times to Mountain time instead of user's timezone

This commit is contained in:
2020-02-24 04:07:18 +00:00
parent 9de7368174
commit b4b94c277f
6 changed files with 22 additions and 14 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import { BrowserRouter as Router, Switch, Route, Link, useParams } from 'react-router-dom';
import './light.css';
import { Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Segment, Table } from 'semantic-ui-react';
import moment from 'moment';
import moment from 'moment-timezone';
import { isInstructor, requester } from './utils.js';
import { NotFound, PleaseLogin } from './Misc.js';
import { InstructorCourseList, InstructorCourseDetail } from './InstructorCourses.js';
@@ -122,10 +122,10 @@ export function CourseDetail(props) {
<Table.Row key={x.id}>
<Table.Cell>
<Link to={'/classes/'+x.id}>
{moment.utc(x.datetime).local().format('ll')}
{moment.utc(x.datetime).tz('America/Edmonton').format('ll')}
</Link>
</Table.Cell>
<Table.Cell>{x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).local().format('LT')}</Table.Cell>
<Table.Cell>{x.is_cancelled ? 'Cancelled' : moment.utc(x.datetime).tz('America/Edmonton').format('LT')}</Table.Cell>
<Table.Cell>{x.instructor_name}</Table.Cell>
<Table.Cell>{x.cost === '0.00' ? 'Free' : '$'+x.cost}</Table.Cell>
</Table.Row>