Skip to content

Commit

Permalink
Updating moment import method to fix StackBlitz bug
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryCarron committed Feb 8, 2021
1 parent 48ad0e9 commit e59d717
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,4 @@
<div class="h-100 flex-grow-1 centerise">
<app-activity-graph [data]="data"></app-activity-graph>
</div>
<!--
<div
class="data-editor-container"
[ngClass]="dataEditorOpen ? 'editor-open' : 'editor-closed'"
>
<app-data-editor [isOpen]="dataEditorOpen"></app-data-editor>
</div> -->
</div>
7 changes: 4 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, OnInit } from "@angular/core";
import { UtilitiesService } from "./utilities.service";
import * as moment from "moment";

import * as moment_ from "moment";
const moment = moment_;
/**
* One Kilometer time in seconds
*/
Expand All @@ -15,7 +15,7 @@ const UPPER_DISTANCE_LIMIT_M = 100000;
*/
const LOWER_DISTANCE_LIMIT_M = 5000;

export const NUMBER_OF_WEEKS = 16;
const NUMBER_OF_WEEKS = 16;

export interface WeekInfo {
displayDate: string;
Expand Down Expand Up @@ -79,6 +79,7 @@ export class AppComponent implements OnInit {

private getWeek(i: number, isSwim: boolean): WeekInfo {
const week = (offset: number) => moment().subtract(offset, "weeks");
const weeka = moment;
const format = (rawWeek) => rawWeek.format("D MMM");
const weekBegining = week(i);
const weekEnding = week(i - 1);
Expand Down

0 comments on commit e59d717

Please sign in to comment.