Convert times to Mountain time instead of user's timezone
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useReducer } from 'react';
|
||||
import { BrowserRouter as Router, Switch, Route, Link, useParams } from 'react-router-dom';
|
||||
import './light.css';
|
||||
import { Button, 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 { isAdmin, isInstructor, BasicTable, requester } from './utils.js';
|
||||
import { NotFound, PleaseLogin } from './Misc.js';
|
||||
import { InstructorClassDetail, InstructorClassAttendance } from './InstructorClasses.js';
|
||||
@@ -31,10 +31,10 @@ function ClassTable(props) {
|
||||
<Table.Cell>{x.course_name}</Table.Cell>
|
||||
<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.Cell>{x.student_count} {!!x.max_students && '/ '+x.max_students}</Table.Cell>
|
||||
@@ -160,13 +160,13 @@ export function ClassDetail(props) {
|
||||
<Table.Row>
|
||||
<Table.Cell>Date:</Table.Cell>
|
||||
<Table.Cell>
|
||||
{moment.utc(clazz.datetime).local().format('ll')}
|
||||
{moment.utc(clazz.datetime).tz('America/Edmonton').format('ll')}
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
<Table.Row>
|
||||
<Table.Cell>Time:</Table.Cell>
|
||||
<Table.Cell>
|
||||
{clazz.is_cancelled ? 'Cancelled' : moment.utc(clazz.datetime).local().format('LT')}
|
||||
{clazz.is_cancelled ? 'Cancelled' : moment.utc(clazz.datetime).tz('America/Edmonton').format('LT')}
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
<Table.Row>
|
||||
|
||||
Reference in New Issue
Block a user