From 61426b29a5ab304b03770fe33500dc72e652b612 Mon Sep 17 00:00:00 2001 From: xmlking Date: Fri, 30 Nov 2018 15:49:12 -0800 Subject: [PATCH] fix(dependencies): removing more moment dependencies --- README.md | 2 +- .../account-edit/account-edit.component.ts | 6 +- .../accounts-table.component.ts | 5 +- libs/grid/src/lib/models/account.model.ts | 3 +- .../src/lib/quickpanel.component.ts | 1 - .../lib/containers/entity/entity.service.ts | 8 +- .../containers/wizdash/wizdash.component.ts | 6 +- .../src/lib/demo-data/inbox-demo-data.ts | 197 +++++++++--------- .../src/lib/demo-data/mail.interface.ts | 4 +- .../src/lib/demo-data/widget-demo-data.ts | 105 ++-------- 10 files changed, 135 insertions(+), 202 deletions(-) diff --git a/README.md b/README.md index 6f15838c7..87e81a24e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This project was generated with [Angular CLI](https://github.com/angular/angular live [Demo](https://xmlking.github.io/ngx-starter-kit/index.html) -**PANTS** (_PostgreSQL_ - _Angular_ - _NestJS_ - _TypeScript_) Stack +**PANTS** (:elephant: _PostgreSQL_ - :a: _Angular_ - :rocket: _NestJS_ - _TypeScript_) Stack in :dolphin: NX workspace ## Install diff --git a/libs/grid/src/lib/components/account-edit/account-edit.component.ts b/libs/grid/src/lib/components/account-edit/account-edit.component.ts index fce8228b9..843cd88f7 100644 --- a/libs/grid/src/lib/components/account-edit/account-edit.component.ts +++ b/libs/grid/src/lib/components/account-edit/account-edit.component.ts @@ -7,7 +7,7 @@ import { Account, Gender } from '../../models/account.model'; import { states } from './states'; import { Observable } from 'rxjs'; import { EntityFormComponent } from '@ngx-starter-kit/shared'; -import * as moment from 'moment'; +import { subYears } from 'date-fns/esm'; @Component({ selector: 'ngx-account-edit', @@ -19,8 +19,8 @@ export class AccountEditComponent extends EntityFormComponent { readonly states: string[] = states; filteredStates: Observable; - readonly maxDate = moment(); - readonly minDate = moment().subtract(100, 'years'); + readonly maxDate = new Date(); + readonly minDate = subYears(this.maxDate, 100); constructor( @Inject(MAT_DIALOG_DATA) public data: { title: string; payload: Account }, diff --git a/libs/grid/src/lib/containers/accounts-table/accounts-table.component.ts b/libs/grid/src/lib/containers/accounts-table/accounts-table.component.ts index 628e47775..4a0801f6f 100644 --- a/libs/grid/src/lib/containers/accounts-table/accounts-table.component.ts +++ b/libs/grid/src/lib/containers/accounts-table/accounts-table.component.ts @@ -7,9 +7,8 @@ import { AppConfirmService } from '@ngx-starter-kit/app-confirm'; import { MatDialog, MatSnackBar } from '@angular/material'; import { catchError, tap, concatMap, filter, map, mergeMap } from 'rxjs/operators'; import { throwError } from 'rxjs'; - +import { format } from 'date-fns/esm'; import { AccountEditComponent } from '../../components/account-edit/account-edit.component'; -import * as moment from 'moment'; import { Navigate } from '@ngxs/router-plugin'; import { Store } from '@ngxs/store'; import { Crumb } from '@ngx-starter-kit/breadcrumbs'; @@ -37,7 +36,7 @@ export class AccountsTableComponent extends EntitiesComponent({ property: 'Name', header: 'Name', displayFn: (entity) => `${entity.first_name} ${entity.last_name}` }), new EntityColumnDef({ property: 'gender', header: 'Gender' }), // prettier-ignore - new EntityColumnDef({ property: 'dob', header: 'DoB', displayFn: (entity) => `${moment(entity.dob).format('LL')}` }), + new EntityColumnDef({ property: 'dob', header: 'DoB', displayFn: (entity) => `${format(entity.dob, 'MMMM dd, yyyy')}` }), new EntityColumnDef({ property: 'city', header: 'City', displayFn: entity => `${entity.address.city}` }), new EntityColumnDef({ property: 'state', diff --git a/libs/grid/src/lib/models/account.model.ts b/libs/grid/src/lib/models/account.model.ts index cfc5316dc..b09b86053 100644 --- a/libs/grid/src/lib/models/account.model.ts +++ b/libs/grid/src/lib/models/account.model.ts @@ -1,12 +1,11 @@ import { Entity } from '@ngx-starter-kit/shared'; -import * as moment from 'moment'; export class Account extends Entity { public id = 0; public first_name?: string; public last_name?: string; public gender?: Gender; - public dob?: moment.Moment; + public dob?: Date; public email?: string; public phone?: string; public company?: string; diff --git a/libs/quickpanel/src/lib/quickpanel.component.ts b/libs/quickpanel/src/lib/quickpanel.component.ts index 0d2014c74..e67e8c7ed 100644 --- a/libs/quickpanel/src/lib/quickpanel.component.ts +++ b/libs/quickpanel/src/lib/quickpanel.component.ts @@ -1,5 +1,4 @@ import { Component, OnInit } from '@angular/core'; -import * as moment from 'moment'; @Component({ selector: 'ngx-quickpanel', diff --git a/libs/shared/src/lib/containers/entity/entity.service.ts b/libs/shared/src/lib/containers/entity/entity.service.ts index b2209f98f..2183692eb 100644 --- a/libs/shared/src/lib/containers/entity/entity.service.ts +++ b/libs/shared/src/lib/containers/entity/entity.service.ts @@ -1,9 +1,9 @@ import { HttpClient, HttpErrorResponse, HttpParams } from '@angular/common/http'; -import { Observable, BehaviorSubject, throwError } from 'rxjs'; +import { BehaviorSubject, Observable, throwError } from 'rxjs'; import { environment } from '@env/environment'; import { Entity } from './entity.model'; -import { map, retry, catchError, finalize } from 'rxjs/operators'; -import * as moment from 'moment'; +import { catchError, finalize, retry } from 'rxjs/operators'; +import { format } from 'date-fns/esm'; export interface Filter { [name: string]: string | string[]; @@ -93,7 +93,7 @@ export abstract class EntityService { protected convertToJson(body: any) { const temporalFunctionToJson = Date.prototype.toJSON; Date.prototype.toJSON = function() { - return moment(this).format('YYYY-MM-DD'); + return format(this, 'YYYY-MM-DD'); }; const jsonBody = JSON.stringify(body); diff --git a/libs/widgets/src/lib/containers/wizdash/wizdash.component.ts b/libs/widgets/src/lib/containers/wizdash/wizdash.component.ts index fc453345b..733e83df2 100644 --- a/libs/widgets/src/lib/containers/wizdash/wizdash.component.ts +++ b/libs/widgets/src/lib/containers/wizdash/wizdash.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { ChartData } from 'chart.js'; -import * as moment from 'moment'; import { Observable } from 'rxjs/internal/Observable'; import { ReplaySubject } from 'rxjs/internal/ReplaySubject'; import { fadeOutAnimation } from '@ngx-starter-kit/animations'; @@ -17,6 +16,7 @@ import { import { RecentSalesWidgetOptions } from '../../components/recent-sales-widget/recent-sales-widget-options.interface'; import { SalesSummaryWidgetOptions } from '../../components/sales-summary-widget/sales-summary-widget-options.interface'; import { WizdashService } from './wizdash.service'; +import { formatDistance } from 'date-fns/esm'; @Component({ selector: 'ngx-wizdash', @@ -185,7 +185,7 @@ export class WizdashComponent implements OnInit { // Prefill realtimeUsersData with 30 random values for (let i = 0; i < 30; i++) { this._realtimeUsersDataSubject.next({ - label: moment().fromNow(), + label: formatDistance(new Date(), new Date()), value: Math.round(Math.random() * (100 - 10) + 10), } as RealtimeUsersWidgetData); } @@ -193,7 +193,7 @@ export class WizdashComponent implements OnInit { // Simulate incoming values for Realtime Users Widget setInterval(() => { this._realtimeUsersDataSubject.next({ - label: moment().fromNow(), + label: formatDistance(new Date(), new Date()), value: Math.round(Math.random() * (100 - 10) + 10), } as RealtimeUsersWidgetData); }, 5000); diff --git a/libs/widgets/src/lib/demo-data/inbox-demo-data.ts b/libs/widgets/src/lib/demo-data/inbox-demo-data.ts index 730dd7a0c..8e9e96146 100755 --- a/libs/widgets/src/lib/demo-data/inbox-demo-data.ts +++ b/libs/widgets/src/lib/demo-data/inbox-demo-data.ts @@ -1,6 +1,7 @@ -import * as moment from 'moment'; import { Color } from './color.interface'; import { Mail } from './mail.interface'; +import { subMinutes, subHours, subDays, subWeeks, subYears } from 'date-fns/esm'; + /* tslint:disable:max-line-length */ export const labelColors: Color[] = [ { @@ -55,7 +56,7 @@ export const inboxMails: Mail[] = [ subject: 'Nulla ut est fugiat sint sit ut id aliqua reprehenderit duis aliquip culpa nostrud.', content: 'Mollit labore consequat adipisicing adipisicing. Ullamco est laboris quis minim consectetur consectetur tempor anim adipisicing est dolore cillum excepteur. Cupidatat ut aliqua nisi reprehenderit Lorem.', - when: moment().subtract(66, 'weeks'), + when: subWeeks(new Date(), 66), read: false, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }, { name: 'Priority', color: '#f44336' }], @@ -75,7 +76,7 @@ export const inboxMails: Mail[] = [ subject: 'Aliquip laboris reprehenderit adipisicing culpa.', content: 'Laboris aute nostrud labore dolore laborum sint occaecat in exercitation dolore qui. Irure velit amet nostrud pariatur et amet incididunt laborum aute. Fugiat voluptate reprehenderit laboris laboris magna consequat ex magna elit fugiat magna dolore aliquip.', - when: moment().subtract(7, 'minutes'), + when: subMinutes(new Date(), 7), read: true, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }, { name: 'Project X', color: '#03A9F4' }], @@ -95,7 +96,7 @@ export const inboxMails: Mail[] = [ subject: 'Esse laboris nulla in pariatur mollit id dolor velit cillum dolor cillum.', content: 'Voluptate irure enim est anim non commodo ad reprehenderit ea quis incididunt et aliquip. Reprehenderit deserunt cupidatat reprehenderit enim quis id tempor ipsum est dolor exercitation consectetur. Tempor nulla do aute veniam qui laboris ullamco voluptate enim.', - when: moment().subtract(94, 'minutes'), + when: subMinutes(new Date(), 94), read: false, starred: false, labels: [], @@ -115,7 +116,7 @@ export const inboxMails: Mail[] = [ subject: 'Minim minim sit labore nostrud cillum labore.', content: 'Voluptate ut enim adipisicing reprehenderit voluptate velit officia dolore quis pariatur adipisicing. Eu occaecat officia in proident do exercitation esse cillum commodo voluptate enim. Laboris est nisi dolore ullamco quis cupidatat aliquip enim occaecat labore laborum elit non.', - when: moment().subtract(50, 'hours'), + when: subHours(new Date(), 50), read: true, starred: false, labels: [], @@ -135,7 +136,7 @@ export const inboxMails: Mail[] = [ subject: 'Mollit labore nisi nostrud non incididunt do ullamco in consequat consequat occaecat adipisicing anim.', content: 'Elit nisi cupidatat voluptate non velit et qui dolore voluptate aute eiusmod officia nulla Lorem. Aliqua ex et do veniam commodo enim. Lorem reprehenderit sunt fugiat cupidatat laborum enim esse pariatur quis eu exercitation dolore incididunt.', - when: moment().subtract(92, 'hours'), + when: subHours(new Date(), 92), read: false, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Project X', color: '#03A9F4' }], @@ -155,7 +156,7 @@ export const inboxMails: Mail[] = [ subject: 'Culpa duis laborum sit minim et ipsum et reprehenderit ut reprehenderit.', content: 'Adipisicing dolor elit excepteur aute aute sit occaecat qui duis Lorem veniam. Culpa sit duis consequat officia dolore tempor cillum ipsum laborum. Pariatur officia laborum nulla dolore amet fugiat commodo mollit amet cupidatat in et.', - when: moment().subtract(38, 'weeks'), + when: subWeeks(new Date(), 38), read: false, starred: false, labels: [], @@ -175,7 +176,7 @@ export const inboxMails: Mail[] = [ subject: 'Ullamco dolore amet reprehenderit consequat cillum ad eiusmod reprehenderit.', content: 'Lorem ad ut nulla labore commodo excepteur dolore est sint. Pariatur adipisicing duis tempor dolor exercitation culpa laboris nulla quis amet irure eu. Deserunt cillum voluptate ut velit et eiusmod labore aute amet.', - when: moment().subtract(39, 'weeks'), + when: subWeeks(new Date(), 39), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }], @@ -195,7 +196,7 @@ export const inboxMails: Mail[] = [ subject: 'Sunt ea laboris enim in sunt aliquip et fugiat occaecat adipisicing irure ea.', content: 'Labore culpa in qui sunt anim ipsum labore reprehenderit ipsum minim sunt voluptate. Commodo fugiat mollit nulla aliquip ullamco pariatur et ipsum sit nulla. Aute commodo magna eiusmod officia do est magna minim sit cillum eu.', - when: moment().subtract(20, 'hours'), + when: subHours(new Date(), 20), read: false, starred: true, labels: [], @@ -216,7 +217,7 @@ export const inboxMails: Mail[] = [ 'Irure voluptate mollit voluptate ut elit Lorem aliquip reprehenderit ut minim adipisicing esse exercitation elit.', content: 'Sit duis eu enim elit consectetur deserunt voluptate id esse consectetur voluptate consequat deserunt in. Voluptate proident excepteur excepteur elit pariatur id labore. Consequat aute deserunt consequat sunt enim aliqua excepteur elit aute nisi.', - when: moment().subtract(11, 'days'), + when: subDays(new Date(), 11), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }], @@ -236,7 +237,7 @@ export const inboxMails: Mail[] = [ subject: 'Pariatur reprehenderit labore consectetur id laboris ipsum Lorem commodo ea minim mollit magna mollit.', content: 'Nulla irure ea voluptate ut laborum dolore proident esse qui eu. Anim dolore magna do velit laboris aliqua nostrud minim ipsum. Qui tempor do est et non amet nostrud anim cupidatat ex aliquip et nisi.', - when: moment().subtract(26, 'days'), + when: subDays(new Date(), 26), read: false, starred: false, labels: [], @@ -256,7 +257,7 @@ export const inboxMails: Mail[] = [ subject: 'Consequat aute ea qui exercitation consequat labore sint anim.', content: 'Est voluptate labore dolore sunt consectetur cillum adipisicing excepteur quis ullamco ex veniam. Fugiat voluptate Lorem incididunt dolor eu aute. Labore esse eiusmod cupidatat ad ullamco laboris ullamco deserunt aliqua sunt eu.', - when: moment().subtract(46, 'minutes'), + when: subMinutes(new Date(), 46), read: true, starred: false, labels: [], @@ -276,7 +277,7 @@ export const inboxMails: Mail[] = [ subject: 'Sit minim enim dolore eiusmod nulla nostrud deserunt laborum enim eiusmod laborum eiusmod.', content: 'Ipsum consequat enim pariatur et nulla magna dolor ex dolore consequat fugiat occaecat. Elit duis sit est voluptate amet exercitation enim consectetur nisi. Esse eu nisi reprehenderit non.', - when: moment().subtract(27, 'days'), + when: subDays(new Date(), 27), read: true, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }], @@ -296,7 +297,7 @@ export const inboxMails: Mail[] = [ subject: 'Enim cillum qui nulla ex do do enim aliqua nostrud consequat enim.', content: 'Et esse fugiat nulla sunt ut sint fugiat. Non duis cillum irure nisi pariatur magna dolore proident. Laboris magna adipisicing consectetur mollit consectetur dolore.', - when: moment().subtract(49, 'hours'), + when: subHours(new Date(), 49), read: false, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Project X', color: '#03A9F4' }], @@ -316,7 +317,7 @@ export const inboxMails: Mail[] = [ subject: 'Voluptate voluptate ad irure ipsum sint deserunt dolor nulla ipsum esse.', content: 'Nostrud magna nisi reprehenderit non adipisicing laboris est tempor consectetur veniam veniam. Ad excepteur tempor in ut labore nulla sint minim exercitation et culpa dolor. Anim reprehenderit occaecat tempor ex cupidatat minim.', - when: moment().subtract(49, 'weeks'), + when: subWeeks(new Date(), 49), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }], @@ -336,7 +337,7 @@ export const inboxMails: Mail[] = [ subject: 'Laborum proident exercitation labore commodo amet irure id quis ea officia sit elit.', content: 'Irure aliqua consectetur ad reprehenderit cillum ullamco commodo excepteur non pariatur. Aliqua excepteur et irure voluptate et do velit dolore ut in enim laborum laboris amet. Esse occaecat cupidatat velit culpa irure.', - when: moment().subtract(26, 'days'), + when: subDays(new Date(), 26), read: false, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }, { name: 'Fun', color: '#9C27B0' }], @@ -356,7 +357,7 @@ export const inboxMails: Mail[] = [ subject: 'Irure cillum labore nostrud irure do commodo officia consectetur cillum laboris quis amet dolore.', content: 'Ex occaecat Lorem adipisicing esse eu non cupidatat cupidatat. Laborum exercitation officia laborum excepteur non proident sint velit dolor duis minim. Cillum officia dolore consequat minim esse labore.', - when: moment().subtract(4, 'hours'), + when: subHours(new Date(), 4), read: true, starred: false, labels: [], @@ -376,7 +377,7 @@ export const inboxMails: Mail[] = [ subject: 'Minim exercitation ipsum dolore sint do.', content: 'Lorem quis est tempor nulla magna consectetur ex voluptate consequat sint ad enim. Amet magna esse do ut laboris. Laborum enim proident ut velit consectetur aute ea irure et minim fugiat ea.', - when: moment().subtract(5, 'minutes'), + when: subMinutes(new Date(), 5), read: true, starred: false, labels: [], @@ -396,7 +397,7 @@ export const inboxMails: Mail[] = [ subject: 'Et fugiat anim sunt voluptate veniam ea anim.', content: 'Amet et dolore in proident tempor fugiat magna veniam laborum in esse quis quis eiusmod. Eu elit culpa irure non do ullamco ea tempor. Officia do deserunt in velit sunt ullamco anim duis eiusmod consequat in.', - when: moment().subtract(69, 'days'), + when: subDays(new Date(), 69), read: true, starred: false, labels: [], @@ -416,7 +417,7 @@ export const inboxMails: Mail[] = [ subject: 'Incididunt reprehenderit fugiat deserunt laborum in ad tempor deserunt irure esse fugiat.', content: 'Sint elit magna laboris laboris. Aliqua sit officia reprehenderit proident in minim enim fugiat do consequat adipisicing enim. Cillum non duis occaecat irure laborum ipsum.', - when: moment().subtract(21, 'hours'), + when: subHours(new Date(), 21), read: false, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }, { name: 'Fun', color: '#9C27B0' }], @@ -436,7 +437,7 @@ export const inboxMails: Mail[] = [ subject: 'Velit culpa qui qui culpa laboris fugiat quis labore velit cillum exercitation velit occaecat.', content: 'Eiusmod aliqua duis mollit culpa aliqua excepteur. In velit commodo fugiat aute minim. Deserunt ea fugiat non culpa adipisicing adipisicing cupidatat.', - when: moment().subtract(71, 'minutes'), + when: subMinutes(new Date(), 71), read: true, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }], @@ -456,7 +457,7 @@ export const inboxMails: Mail[] = [ subject: 'Commodo quis commodo nostrud eiusmod sunt mollit non anim excepteur.', content: 'Esse non culpa culpa occaecat dolor sint. Qui veniam aute dolore labore dolore excepteur. Est Lorem sint incididunt sint ex.', - when: moment().subtract(82, 'weeks'), + when: subWeeks(new Date(), 82), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }], @@ -476,7 +477,7 @@ export const inboxMails: Mail[] = [ subject: 'Anim aliqua officia cillum non nisi quis Lorem duis labore do consectetur anim.', content: 'Enim nulla officia non anim duis exercitation ut eu laborum Lorem excepteur commodo duis reprehenderit. Cupidatat deserunt non exercitation labore eu pariatur labore ut id aliqua voluptate sunt. Exercitation dolore deserunt pariatur exercitation occaecat deserunt exercitation nostrud quis incididunt sunt Lorem ut.', - when: moment().subtract(30, 'minutes'), + when: subMinutes(new Date(), 30), read: true, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }, { name: 'Priority', color: '#f44336' }], @@ -496,7 +497,7 @@ export const inboxMails: Mail[] = [ subject: 'Occaecat non quis ut sint magna aliquip esse sit incididunt irure exercitation.', content: 'Aliqua ex aliqua quis tempor id. Officia reprehenderit occaecat voluptate consectetur duis minim Lorem cillum minim ea aute aliquip. Amet voluptate aute ea id.', - when: moment().subtract(36, 'hours'), + when: subHours(new Date(), 36), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }], @@ -516,7 +517,7 @@ export const inboxMails: Mail[] = [ subject: 'Sit eiusmod sit consectetur nisi enim.', content: 'Consectetur adipisicing eu tempor sunt est laborum irure qui. Lorem labore velit duis sit anim dolore et elit excepteur cupidatat in cillum pariatur esse. Nulla esse duis proident culpa sit eu sint.', - when: moment().subtract(34, 'days'), + when: subDays(new Date(), 34), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }], @@ -536,7 +537,7 @@ export const inboxMails: Mail[] = [ subject: 'Non ea officia voluptate do aute ea elit minim.', content: 'Velit magna nostrud laboris consequat ut. Nisi esse non sunt dolore culpa ullamco. Ad non eiusmod esse adipisicing aute labore do reprehenderit culpa in eu occaecat qui.', - when: moment().subtract(50, 'weeks'), + when: subWeeks(new Date(), 50), read: false, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Fun', color: '#9C27B0' }], @@ -556,7 +557,7 @@ export const inboxMails: Mail[] = [ subject: 'Incididunt reprehenderit fugiat ad ullamco nulla minim consequat sunt.', content: 'Tempor exercitation minim reprehenderit culpa nostrud minim. Nulla irure incididunt officia anim Lorem. Cupidatat consectetur velit velit esse id veniam excepteur.', - when: moment().subtract(33, 'minutes'), + when: subMinutes(new Date(), 33), read: false, starred: false, labels: [], @@ -576,7 +577,7 @@ export const inboxMails: Mail[] = [ subject: 'Qui duis id exercitation sint duis dolor excepteur qui tempor irure et minim culpa ad.', content: 'Dolor est veniam ullamco esse eu ad deserunt fugiat reprehenderit officia id. Consectetur est minim incididunt consectetur Lorem deserunt deserunt. In do reprehenderit cillum dolor ea et quis aliqua labore dolore veniam et eu culpa.', - when: moment().subtract(26, 'hours'), + when: subHours(new Date(), 26), read: false, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }, { name: 'Project X', color: '#03A9F4' }], @@ -596,7 +597,7 @@ export const inboxMails: Mail[] = [ subject: 'Mollit do in laboris quis cillum mollit nulla non.', content: 'Fugiat ut amet veniam irure ea esse eiusmod occaecat dolore aute magna dolor. Mollit elit sint ullamco aliqua deserunt qui amet ipsum ex qui. Officia tempor in consectetur eiusmod esse.', - when: moment().subtract(30, 'days'), + when: subDays(new Date(), 30), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }], @@ -616,7 +617,7 @@ export const inboxMails: Mail[] = [ subject: 'Minim proident ex id tempor veniam pariatur.', content: 'Ullamco pariatur veniam aliqua amet proident proident fugiat velit esse. Amet in exercitation officia tempor do officia dolor aliquip. Non sunt adipisicing cillum est incididunt est velit dolore laborum enim nulla.', - when: moment().subtract(31, 'minutes'), + when: subMinutes(new Date(), 31), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }], @@ -636,7 +637,7 @@ export const inboxMails: Mail[] = [ subject: 'Anim ut id qui ipsum incididunt in minim veniam incididunt quis.', content: 'Ad ullamco cillum cupidatat proident dolor qui eu. Sit amet reprehenderit irure sit eiusmod pariatur pariatur magna deserunt fugiat mollit ut. Et laborum fugiat mollit amet.', - when: moment().subtract(98, 'weeks'), + when: subWeeks(new Date(), 98), read: true, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }], @@ -656,7 +657,7 @@ export const inboxMails: Mail[] = [ subject: 'Id aute in et veniam.', content: 'Quis sunt ad est qui occaecat incididunt minim ex eiusmod pariatur proident Lorem laborum sint. Pariatur quis eu Lorem nulla sit enim. Dolor aute veniam eiusmod sunt ullamco officia dolore ad sint nulla labore.', - when: moment().subtract(63, 'weeks'), + when: subWeeks(new Date(), 63), read: true, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }], @@ -676,7 +677,7 @@ export const inboxMails: Mail[] = [ subject: 'Esse est nisi anim elit quis laboris ea eiusmod do voluptate velit.', content: 'Sit ad veniam sint amet excepteur adipisicing ea aliqua tempor reprehenderit adipisicing minim ad nulla. Sunt Lorem pariatur est reprehenderit sit consequat aliquip amet duis laborum mollit adipisicing esse. Sint velit et elit nulla laborum.', - when: moment().subtract(26, 'weeks'), + when: subWeeks(new Date(), 26), read: true, starred: false, labels: [], @@ -696,7 +697,7 @@ export const inboxMails: Mail[] = [ subject: 'Qui nulla occaecat do fugiat.', content: 'Ullamco culpa Lorem adipisicing in exercitation dolor fugiat quis nulla. Veniam in cupidatat ea proident consectetur sunt anim elit consequat minim ex. Cillum veniam reprehenderit cillum labore elit irure cillum.', - when: moment().subtract(91, 'weeks'), + when: subWeeks(new Date(), 91), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }, { name: 'Business', color: '#3F51B5' }], @@ -716,7 +717,7 @@ export const inboxMails: Mail[] = [ subject: 'Veniam ut voluptate laborum nisi id ea Lorem qui quis adipisicing excepteur et.', content: 'Magna tempor labore consequat occaecat eiusmod occaecat anim sint ad cupidatat est sint labore est. Reprehenderit cupidatat minim ullamco dolor cupidatat commodo consectetur id est commodo minim consectetur reprehenderit. Sint amet esse mollit voluptate proident cupidatat id nulla nostrud ad adipisicing minim laboris.', - when: moment().subtract(2, 'minutes'), + when: subMinutes(new Date(), 2), read: false, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }], @@ -736,7 +737,7 @@ export const inboxMails: Mail[] = [ subject: 'Dolore aliquip velit consequat incididunt culpa ipsum fugiat magna exercitation ut consectetur ea.', content: 'Elit eiusmod dolore est ex anim dolor culpa sint consequat. Deserunt nisi mollit anim anim esse exercitation magna aliqua. Sint laboris labore esse nostrud est esse minim id nulla ad nostrud ad irure.', - when: moment().subtract(12, 'minutes'), + when: subMinutes(new Date(), 12), read: false, starred: false, labels: [], @@ -756,7 +757,7 @@ export const inboxMails: Mail[] = [ subject: 'Irure fugiat ea ipsum eiusmod culpa deserunt proident esse.', content: 'Consectetur amet sint aliquip sit labore do laborum officia duis Lorem qui sint adipisicing commodo. Proident non consequat do consectetur mollit consequat est fugiat. Duis dolor dolor sit et in consequat consequat quis deserunt Lorem nisi ullamco.', - when: moment().subtract(55, 'weeks'), + when: subWeeks(new Date(), 55), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Fun', color: '#9C27B0' }], @@ -776,7 +777,7 @@ export const inboxMails: Mail[] = [ subject: 'Incididunt laboris reprehenderit ut exercitation exercitation aliquip consequat.', content: 'Est fugiat aute dolor anim laboris ut consequat nulla cupidatat duis laborum cupidatat ullamco. Minim cupidatat ad aute pariatur labore irure cupidatat sunt anim nisi. Amet esse labore voluptate mollit consectetur proident adipisicing sit excepteur cillum ad.', - when: moment().subtract(21, 'minutes'), + when: subMinutes(new Date(), 21), read: true, starred: false, labels: [], @@ -796,7 +797,7 @@ export const inboxMails: Mail[] = [ subject: 'Non non dolor laboris sit aliquip est pariatur ad in do duis Lorem.', content: 'Anim qui incididunt ex deserunt occaecat laborum proident in deserunt. Anim ipsum qui aliquip laborum in ut elit quis labore et. Pariatur proident consequat fugiat nisi ullamco enim culpa nisi nisi adipisicing veniam.', - when: moment().subtract(8, 'minutes'), + when: subMinutes(new Date(), 8), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Priority', color: '#f44336' }], @@ -816,7 +817,7 @@ export const inboxMails: Mail[] = [ subject: 'Aute proident id id ad ad cupidatat.', content: 'Do ad duis sunt dolor fugiat reprehenderit mollit adipisicing deserunt sunt minim. Id proident ullamco Lorem amet culpa velit eu officia excepteur. Laborum exercitation fugiat aute dolor magna non dolore ut.', - when: moment().subtract(86, 'days'), + when: subDays(new Date(), 86), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Fun', color: '#9C27B0' }], @@ -836,7 +837,7 @@ export const inboxMails: Mail[] = [ subject: 'Laboris anim excepteur consectetur occaecat ut non.', content: 'Lorem nostrud et est Lorem irure veniam Lorem deserunt tempor nostrud culpa. Ut nulla amet irure magna reprehenderit culpa pariatur est ut sint ullamco nostrud. Pariatur dolor elit nulla cillum nostrud id.', - when: moment().subtract(63, 'hours'), + when: subHours(new Date(), 63), read: true, starred: false, labels: [], @@ -856,7 +857,7 @@ export const inboxMails: Mail[] = [ subject: 'Pariatur cillum pariatur dolore esse incididunt ut quis enim culpa.', content: 'Commodo aliquip labore cillum esse in aute aliqua. Proident adipisicing Lorem deserunt dolore est do non magna Lorem officia laborum dolore dolor dolor. Ipsum aliqua velit incididunt dolor eu laborum pariatur ipsum duis duis sit incididunt velit.', - when: moment().subtract(11, 'minutes'), + when: subMinutes(new Date(), 11), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }], @@ -876,7 +877,7 @@ export const inboxMails: Mail[] = [ subject: 'Incididunt deserunt sint laboris commodo ea et ullamco voluptate cupidatat esse eiusmod qui.', content: 'In dolore voluptate ullamco eu duis minim eiusmod duis anim minim. Dolore labore ipsum officia ipsum dolore commodo mollit. Esse fugiat commodo nulla dolor non commodo culpa laboris et id eiusmod laboris cupidatat velit.', - when: moment().subtract(51, 'weeks'), + when: subWeeks(new Date(), 51), read: true, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }], @@ -896,7 +897,7 @@ export const inboxMails: Mail[] = [ subject: 'Lorem proident aliqua mollit aliquip sint velit.', content: 'Aliqua commodo consectetur aute ut. Ipsum excepteur fugiat mollit adipisicing incididunt anim eiusmod non cupidatat. Commodo deserunt proident aute minim.', - when: moment().subtract(48, 'hours'), + when: subHours(new Date(), 48), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }, { name: 'Project X', color: '#03A9F4' }], @@ -916,7 +917,7 @@ export const inboxMails: Mail[] = [ subject: 'Non ex excepteur amet consequat est deserunt.', content: 'Voluptate in pariatur Lorem pariatur eu et eu eiusmod aute esse. Est sint dolor Lorem do esse laboris minim excepteur sunt irure ex. Officia exercitation Lorem reprehenderit ut ut sunt qui aute.', - when: moment().subtract(41, 'weeks'), + when: subWeeks(new Date(), 41), read: false, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Fun', color: '#9C27B0' }], @@ -936,7 +937,7 @@ export const inboxMails: Mail[] = [ subject: 'Incididunt duis consequat irure qui velit deserunt velit consequat do eiusmod non sint sint tempor.', content: 'Aliquip aliquip occaecat enim aliquip minim ea aliquip consectetur labore eiusmod adipisicing nostrud. Incididunt laboris tempor minim ipsum sint aliquip dolore anim in. Reprehenderit esse labore irure id cupidatat nostrud cupidatat Lorem fugiat est eu consectetur.', - when: moment().subtract(24, 'minutes'), + when: subMinutes(new Date(), 24), read: false, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }, { name: 'Priority', color: '#f44336' }], @@ -956,7 +957,7 @@ export const inboxMails: Mail[] = [ subject: 'Exercitation pariatur in culpa eiusmod aliqua et aute.', content: 'Ut occaecat pariatur enim commodo ad dolor incididunt laboris occaecat nulla nulla. Velit voluptate veniam amet labore aliqua eiusmod adipisicing. Mollit minim consectetur labore ipsum adipisicing nisi enim officia.', - when: moment().subtract(55, 'weeks'), + when: subWeeks(new Date(), 55), read: true, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }], @@ -976,7 +977,7 @@ export const inboxMails: Mail[] = [ subject: 'Anim ex irure culpa mollit ut anim laborum.', content: 'Dolore dolore nisi quis pariatur sunt in commodo aute. Nisi adipisicing aliqua officia adipisicing dolor deserunt reprehenderit consectetur qui elit elit. Cillum incididunt nisi reprehenderit aliquip ullamco et.', - when: moment().subtract(46, 'minutes'), + when: subMinutes(new Date(), 46), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }], @@ -996,7 +997,7 @@ export const inboxMails: Mail[] = [ subject: 'Do aliquip pariatur cupidatat dolor voluptate incididunt elit.', content: 'Id adipisicing ullamco et est ullamco est. Sint laborum id veniam deserunt sunt tempor ut in sint reprehenderit reprehenderit. Nisi sit aliqua laboris veniam sunt.', - when: moment().subtract(60, 'hours'), + when: subHours(new Date(), 60), read: false, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }], @@ -1016,7 +1017,7 @@ export const inboxMails: Mail[] = [ subject: 'Cillum ipsum nulla deserunt cupidatat officia nulla ex tempor enim labore.', content: 'Enim occaecat ipsum dolore irure deserunt nostrud ipsum nulla adipisicing. Sunt occaecat et culpa adipisicing aliquip. Nostrud ut id deserunt voluptate mollit eiusmod qui id culpa.', - when: moment().subtract(7, 'days'), + when: subDays(new Date(), 7), read: false, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }], @@ -1036,7 +1037,7 @@ export const inboxMails: Mail[] = [ subject: 'Velit sunt deserunt tempor consectetur proident tempor ut laborum id anim consequat ullamco qui.', content: 'Adipisicing consectetur adipisicing incididunt deserunt id nisi nulla eu excepteur. Sint ullamco nostrud minim esse do. Excepteur eu ut proident elit esse ex dolor consequat veniam mollit do excepteur.', - when: moment().subtract(41, 'days'), + when: subDays(new Date(), 41), read: true, starred: false, labels: [], @@ -1056,7 +1057,7 @@ export const inboxMails: Mail[] = [ subject: 'Ex irure laborum eiusmod amet dolore.', content: 'Sint in consequat in nisi cupidatat fugiat mollit in. Enim aliquip laboris sint aute nulla commodo sunt. Proident consequat occaecat pariatur ullamco Lorem ut tempor nisi in fugiat.', - when: moment().subtract(76, 'hours'), + when: subHours(new Date(), 76), read: true, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }, { name: 'Priority', color: '#f44336' }], @@ -1076,7 +1077,7 @@ export const inboxMails: Mail[] = [ subject: 'Amet eu adipisicing qui aute ut tempor elit do eu tempor culpa voluptate.', content: 'Adipisicing aliquip adipisicing ipsum reprehenderit excepteur anim laboris ex laboris labore non incididunt nulla. Anim et minim veniam duis laboris exercitation aliquip. Enim sit fugiat deserunt deserunt anim Lorem in enim fugiat duis Lorem.', - when: moment().subtract(34, 'days'), + when: subDays(new Date(), 34), read: false, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }, { name: 'Fun', color: '#9C27B0' }], @@ -1096,7 +1097,7 @@ export const inboxMails: Mail[] = [ subject: 'Ea anim eu ut consequat adipisicing tempor cillum deserunt velit incididunt tempor sunt incididunt.', content: 'Lorem labore do deserunt magna. Deserunt aute ea consectetur nostrud aliqua minim sint labore laboris magna magna culpa. Ea ea consectetur excepteur occaecat ea consequat ea sint.', - when: moment().subtract(76, 'days'), + when: subDays(new Date(), 76), read: true, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }], @@ -1116,7 +1117,7 @@ export const inboxMails: Mail[] = [ subject: 'Cillum fugiat sit duis et aute.', content: 'Id sint nulla nostrud id consequat occaecat aute ullamco Lorem velit ut deserunt. Ad cupidatat sunt velit fugiat anim laboris irure proident ipsum reprehenderit aliquip qui. In minim commodo nisi laborum aliqua duis.', - when: moment().subtract(21, 'minutes'), + when: subMinutes(new Date(), 21), read: true, starred: false, labels: [], @@ -1136,7 +1137,7 @@ export const inboxMails: Mail[] = [ subject: 'Exercitation officia excepteur sit labore.', content: 'Velit commodo laborum aliqua cillum dolor aliquip voluptate fugiat deserunt tempor. Reprehenderit magna nulla deserunt sunt aliquip consequat velit. Labore incididunt eiusmod ex consectetur ad dolor.', - when: moment().subtract(92, 'weeks'), + when: subWeeks(new Date(), 92), read: false, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }, { name: 'Fun', color: '#9C27B0' }], @@ -1156,7 +1157,7 @@ export const inboxMails: Mail[] = [ subject: 'Exercitation duis aliqua nulla aliqua consequat nisi qui Lorem in duis.', content: 'Dolor sunt deserunt culpa ut dolor amet enim irure incididunt quis laborum. Anim duis veniam velit dolor incididunt proident occaecat adipisicing dolore enim duis irure. Enim sint ad nostrud est.', - when: moment().subtract(13, 'minutes'), + when: subMinutes(new Date(), 13), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }], @@ -1176,7 +1177,7 @@ export const inboxMails: Mail[] = [ subject: 'Exercitation eu do nulla occaecat veniam magna veniam ut ad.', content: 'Est deserunt est minim duis anim pariatur velit veniam consectetur duis ipsum tempor dolore. Excepteur tempor tempor esse ut aliquip nulla nulla nulla. Pariatur officia velit dolore officia qui quis non.', - when: moment().subtract(21, 'days'), + when: subDays(new Date(), 21), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }], @@ -1196,7 +1197,7 @@ export const inboxMails: Mail[] = [ subject: 'Pariatur fugiat eiusmod fugiat quis consectetur laboris ipsum cillum non aliqua laboris.', content: 'Duis amet Lorem mollit adipisicing exercitation elit laboris sint exercitation ad occaecat esse quis nostrud. Cillum esse aliquip voluptate ullamco dolore est duis anim ipsum duis ex dolor. Labore aliqua pariatur proident ad mollit duis duis non nulla dolore cupidatat quis cupidatat.', - when: moment().subtract(36, 'days'), + when: subDays(new Date(), 36), read: false, starred: false, labels: [{ name: 'Priority', color: '#f44336' }, { name: 'Project X', color: '#03A9F4' }], @@ -1216,7 +1217,7 @@ export const inboxMails: Mail[] = [ subject: 'Consequat laboris quis exercitation sunt adipisicing cupidatat labore aliqua.', content: 'Excepteur elit incididunt excepteur officia ex anim ut irure Lorem laborum cupidatat nisi dolor. Ut incididunt enim ut quis. Reprehenderit excepteur quis laborum cillum.', - when: moment().subtract(65, 'hours'), + when: subHours(new Date(), 65), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }], @@ -1236,7 +1237,7 @@ export const inboxMails: Mail[] = [ subject: 'Lorem ullamco dolore quis pariatur ullamco esse.', content: 'Veniam dolore Lorem aliqua cupidatat. Ut cupidatat officia occaecat exercitation enim Lorem aliquip. Nulla quis exercitation dolor excepteur eu in id incididunt irure fugiat ea sit eu.', - when: moment().subtract(99, 'minutes'), + when: subMinutes(new Date(), 99), read: false, starred: true, labels: [{ name: 'Project X', color: '#03A9F4' }], @@ -1256,7 +1257,7 @@ export const inboxMails: Mail[] = [ subject: 'Mollit eu velit nostrud adipisicing incididunt qui anim nisi pariatur eiusmod irure incididunt.', content: 'Sit quis est do culpa laboris. Excepteur consequat occaecat pariatur magna veniam. Fugiat ipsum velit consectetur exercitation eiusmod duis consectetur minim culpa do.', - when: moment().subtract(82, 'weeks'), + when: subWeeks(new Date(), 82), read: true, starred: false, labels: [], @@ -1276,7 +1277,7 @@ export const inboxMails: Mail[] = [ subject: 'Quis anim minim velit ea.', content: 'Aute aute sint reprehenderit et tempor anim consequat velit sit anim. Aute deserunt labore cupidatat ullamco. Consectetur nostrud consectetur fugiat tempor occaecat consectetur nulla voluptate.', - when: moment().subtract(4, 'days'), + when: subDays(new Date(), 4), read: true, starred: false, labels: [], @@ -1296,7 +1297,7 @@ export const inboxMails: Mail[] = [ subject: 'Irure exercitation quis nulla irure ea minim nostrud anim id.', content: 'Anim et aute voluptate fugiat laborum non culpa. Voluptate cupidatat commodo mollit et non nisi cillum duis sint mollit. Lorem officia ea ad consectetur excepteur laboris officia labore pariatur fugiat ad magna labore labore.', - when: moment().subtract(66, 'weeks'), + when: subWeeks(new Date(), 66), read: true, starred: false, labels: [], @@ -1316,7 +1317,7 @@ export const inboxMails: Mail[] = [ subject: 'Ad eiusmod ex velit dolore eu.', content: 'Occaecat ipsum nulla reprehenderit tempor nulla culpa quis ex ad. Amet amet non aute non fugiat Lorem elit qui esse duis proident sit. Ex incididunt aliqua irure ea consectetur velit.', - when: moment().subtract(39, 'days'), + when: subDays(new Date(), 39), read: false, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Project X', color: '#03A9F4' }], @@ -1336,7 +1337,7 @@ export const inboxMails: Mail[] = [ subject: 'Sit anim sunt aute do enim occaecat et eiusmod.', content: 'Minim non non quis esse Lorem aute. Laboris nisi ea do occaecat exercitation qui eiusmod ut magna dolor ea do dolore. Dolore pariatur esse non excepteur ad voluptate ullamco magna laborum quis.', - when: moment().subtract(25, 'weeks'), + when: subWeeks(new Date(), 25), read: false, starred: false, labels: [], @@ -1356,7 +1357,7 @@ export const inboxMails: Mail[] = [ subject: 'Proident velit consequat proident elit ex nostrud eu cupidatat cupidatat anim ex dolor.', content: 'Id minim ut ut labore officia. Id enim do eu duis nulla exercitation. Consectetur minim excepteur ipsum quis deserunt pariatur exercitation aliquip in.', - when: moment().subtract(69, 'minutes'), + when: subMinutes(new Date(), 69), read: true, starred: false, labels: [{ name: 'Priority', color: '#f44336' }, { name: 'Business', color: '#3F51B5' }], @@ -1376,7 +1377,7 @@ export const inboxMails: Mail[] = [ subject: 'Consequat duis eiusmod nulla anim aliqua ipsum.', content: 'Sint dolor id do ullamco cupidatat mollit aliquip ullamco velit. Occaecat eu esse ut culpa. Laborum ea proident ut non excepteur.', - when: moment().subtract(42, 'weeks'), + when: subWeeks(new Date(), 42), read: false, starred: false, labels: [{ name: 'Priority', color: '#f44336' }], @@ -1396,7 +1397,7 @@ export const inboxMails: Mail[] = [ subject: 'Cillum laborum amet dolor in magna cupidatat et consectetur sit sunt laborum ullamco.', content: 'Ad quis commodo laboris dolor magna et incididunt excepteur incididunt ipsum consectetur. Dolor ullamco minim anim deserunt et minim culpa commodo qui occaecat. Aliqua incididunt in aliquip aliquip occaecat pariatur enim.', - when: moment().subtract(56, 'minutes'), + when: subMinutes(new Date(), 56), read: true, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }, { name: 'Project X', color: '#03A9F4' }], @@ -1416,7 +1417,7 @@ export const inboxMails: Mail[] = [ subject: 'Anim ullamco ex esse non amet commodo elit dolore proident commodo sint laborum.', content: 'Officia voluptate eu ipsum tempor consequat sint proident nulla officia. Irure duis in esse laborum tempor irure aliqua velit voluptate eu amet ipsum exercitation. Dolor in ex et anim.', - when: moment().subtract(14, 'weeks'), + when: subWeeks(new Date(), 14), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }], @@ -1436,7 +1437,7 @@ export const inboxMails: Mail[] = [ subject: 'Consectetur sint nulla laboris exercitation minim eu dolore nisi deserunt dolore minim est qui ad.', content: 'Id enim ea deserunt nostrud eiusmod. Duis veniam enim occaecat duis sint est. Voluptate id enim exercitation culpa commodo cillum ut nisi.', - when: moment().subtract(83, 'weeks'), + when: subWeeks(new Date(), 83), read: false, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }, { name: 'Project X', color: '#03A9F4' }], @@ -1456,7 +1457,7 @@ export const inboxMails: Mail[] = [ subject: 'Ipsum esse proident sunt nisi.', content: 'Nisi minim consequat deserunt ut exercitation dolore est tempor et. Elit est pariatur id dolor non elit eu veniam quis quis ut est cupidatat. Ut consectetur magna anim ex duis do incididunt voluptate exercitation consequat.', - when: moment().subtract(97, 'hours'), + when: subHours(new Date(), 97), read: true, starred: false, labels: [], @@ -1476,7 +1477,7 @@ export const inboxMails: Mail[] = [ subject: 'Nostrud dolore culpa esse ut consequat Lorem sit fugiat nulla elit pariatur duis nulla occaecat.', content: 'Fugiat qui laborum Lorem deserunt enim ipsum non ea deserunt ut enim cillum proident eiusmod. Eu eu dolore eu nostrud laborum nulla. Ut sint nostrud excepteur adipisicing nulla sit.', - when: moment().subtract(92, 'weeks'), + when: subWeeks(new Date(), 92), read: true, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }, { name: 'Project X', color: '#03A9F4' }], @@ -1496,7 +1497,7 @@ export const inboxMails: Mail[] = [ subject: 'Pariatur proident minim amet deserunt consectetur voluptate esse sunt ea anim sit.', content: 'Eiusmod ullamco adipisicing et dolore et labore anim consectetur sint do ipsum. Occaecat dolor do amet id magna ullamco nulla ipsum tempor. Magna laborum duis id laborum adipisicing sit officia aute elit.', - when: moment().subtract(47, 'hours'), + when: subHours(new Date(), 47), read: false, starred: false, labels: [], @@ -1516,7 +1517,7 @@ export const inboxMails: Mail[] = [ subject: 'Ullamco culpa cupidatat ex ipsum magna cupidatat tempor pariatur consectetur Lorem amet ad est.', content: 'Proident sunt est nisi id do veniam. Enim fugiat in aliquip adipisicing elit. Do adipisicing et ut do non eiusmod sint velit tempor veniam exercitation qui cupidatat.', - when: moment().subtract(9, 'days'), + when: subDays(new Date(), 9), read: false, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }], @@ -1536,7 +1537,7 @@ export const inboxMails: Mail[] = [ subject: 'Esse irure aliquip officia excepteur commodo adipisicing duis elit eiusmod mollit in.', content: 'Eiusmod labore aliquip laboris sint fugiat anim veniam ex. Mollit ipsum commodo in officia velit Lorem elit. Excepteur culpa Lorem aliquip ea.', - when: moment().subtract(89, 'weeks'), + when: subWeeks(new Date(), 89), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Priority', color: '#f44336' }], @@ -1556,7 +1557,7 @@ export const inboxMails: Mail[] = [ subject: 'Irure consectetur labore laboris reprehenderit ex.', content: 'Est aute incididunt dolore ex est adipisicing sint sit sint non laboris. Sit in ut nostrud est deserunt. Eiusmod pariatur veniam cillum sit quis occaecat irure exercitation officia.', - when: moment().subtract(52, 'minutes'), + when: subMinutes(new Date(), 52), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Fun', color: '#9C27B0' }], @@ -1576,7 +1577,7 @@ export const inboxMails: Mail[] = [ subject: 'Culpa nostrud officia occaecat cillum est sint veniam laborum voluptate velit do eu.', content: 'Anim dolor est commodo quis laborum aute velit mollit duis nostrud deserunt et consequat. Eu nostrud est enim adipisicing laboris proident cillum ex. Laborum est consequat veniam laborum sint aute.', - when: moment().subtract(13, 'days'), + when: subDays(new Date(), 23), read: true, starred: false, labels: [], @@ -1597,7 +1598,7 @@ export const inboxMails: Mail[] = [ 'Dolor esse ea voluptate nulla cupidatat nostrud consectetur laboris nostrud tempor mollit tempor officia excepteur.', content: 'Ut consequat amet exercitation officia elit laboris tempor excepteur. Reprehenderit quis sunt sit elit est mollit in exercitation est excepteur pariatur consectetur elit minim. Consequat aute deserunt officia nostrud irure esse aliqua exercitation ea non.', - when: moment().subtract(34, 'days'), + when: subDays(new Date(), 34), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }], @@ -1617,7 +1618,7 @@ export const inboxMails: Mail[] = [ subject: 'Sint sint enim adipisicing est.', content: 'Cupidatat dolore nulla ex proident magna cupidatat aliquip amet quis ut minim consectetur reprehenderit. Occaecat proident exercitation sit officia deserunt et. Adipisicing laborum mollit quis enim nostrud duis magna ea nostrud aliquip ipsum irure.', - when: moment().subtract(3, 'minutes'), + when: subMinutes(new Date(), 3), read: true, starred: false, labels: [], @@ -1637,7 +1638,7 @@ export const inboxMails: Mail[] = [ subject: 'Occaecat eiusmod magna aute ipsum tempor voluptate enim sunt.', content: 'Occaecat mollit veniam aute magna dolor excepteur culpa. Elit commodo ipsum incididunt non officia sit reprehenderit non in sit. Mollit irure cupidatat esse ex ex.', - when: moment().subtract(28, 'weeks'), + when: subWeeks(new Date(), 28), read: false, starred: false, labels: [], @@ -1657,7 +1658,7 @@ export const inboxMails: Mail[] = [ subject: 'Ullamco magna sunt ad consectetur duis nostrud do ex cupidatat dolore culpa labore.', content: 'Deserunt est fugiat elit eiusmod adipisicing officia. Ad exercitation occaecat consectetur labore reprehenderit commodo. Dolore irure ad do commodo anim.', - when: moment().subtract(78, 'hours'), + when: subHours(new Date(), 78), read: true, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }], @@ -1677,7 +1678,7 @@ export const inboxMails: Mail[] = [ subject: 'Et ex commodo enim aliqua non nisi esse sunt ipsum in incididunt do.', content: 'Commodo sint irure fugiat laboris eu deserunt anim occaecat aute commodo pariatur. Amet voluptate ex mollit incididunt duis consequat cupidatat cupidatat laborum officia nisi culpa sit. Aliqua non commodo consectetur adipisicing.', - when: moment().subtract(34, 'minutes'), + when: subMinutes(new Date(), 34), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Priority', color: '#f44336' }], @@ -1697,7 +1698,7 @@ export const inboxMails: Mail[] = [ subject: 'Officia mollit irure id sint voluptate et enim esse sint minim in fugiat.', content: 'Ipsum incididunt quis nisi aliqua eiusmod quis tempor. Consectetur reprehenderit dolor excepteur irure mollit consectetur cupidatat. Laboris reprehenderit Lorem irure anim cillum et.', - when: moment().subtract(12, 'minutes'), + when: subMinutes(new Date(), 12), read: true, starred: true, labels: [{ name: 'Business', color: '#3F51B5' }, { name: 'Priority', color: '#f44336' }], @@ -1717,7 +1718,7 @@ export const inboxMails: Mail[] = [ subject: 'Ipsum minim elit duis officia aute anim magna mollit duis quis.', content: 'Ex deserunt ut officia do. Lorem ullamco aute consectetur minim culpa. Ea incididunt dolore nulla excepteur nulla qui exercitation sit laborum.', - when: moment().subtract(95, 'days'), + when: subDays(new Date(), 95), read: false, starred: false, labels: [{ name: 'Business', color: '#3F51B5' }], @@ -1737,7 +1738,7 @@ export const inboxMails: Mail[] = [ subject: 'Consectetur ipsum dolor ullamco ut exercitation aliqua labore do ea ea dolore irure.', content: 'Sunt nisi consequat reprehenderit ullamco ut consequat laboris laborum laboris magna irure culpa. Nisi nisi velit ut pariatur eiusmod velit consequat elit mollit laborum exercitation sunt. Excepteur magna et est enim deserunt nostrud consequat nisi quis ad Lorem officia eu cupidatat.', - when: moment().subtract(41, 'minutes'), + when: subMinutes(new Date(), 41), read: false, starred: true, labels: [{ name: 'Fun', color: '#9C27B0' }, { name: 'Priority', color: '#f44336' }], @@ -1757,7 +1758,7 @@ export const inboxMails: Mail[] = [ subject: 'Elit est qui laborum exercitation labore pariatur dolore commodo enim laboris enim ea.', content: 'Laboris non est veniam incididunt. Culpa excepteur est aliquip amet duis occaecat amet aute aliqua. Amet ad cillum fugiat adipisicing consequat elit aliqua.', - when: moment().subtract(5, 'weeks'), + when: subWeeks(new Date(), 5), read: false, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }], @@ -1777,7 +1778,7 @@ export const inboxMails: Mail[] = [ subject: 'Do mollit consequat adipisicing sunt laborum proident labore.', content: 'Laborum incididunt quis ullamco est ut. Elit proident dolor id voluptate sit. Ad Lorem dolor et amet deserunt eiusmod sunt ut in.', - when: moment().subtract(74, 'days'), + when: subDays(new Date(), 74), read: false, starred: true, labels: [], @@ -1797,7 +1798,7 @@ export const inboxMails: Mail[] = [ subject: 'Laboris exercitation ea do culpa aute non id nostrud dolor laborum duis eiusmod.', content: 'Fugiat non eu sunt do et velit ipsum enim excepteur aute adipisicing pariatur pariatur. Cupidatat irure veniam enim eiusmod. Fugiat laborum culpa labore in culpa exercitation reprehenderit laborum cupidatat reprehenderit ad laborum.', - when: moment().subtract(36, 'minutes'), + when: subMinutes(new Date(), 36), read: true, starred: false, labels: [{ name: 'Fun', color: '#9C27B0' }], @@ -1817,7 +1818,7 @@ export const inboxMails: Mail[] = [ subject: 'Occaecat consectetur voluptate exercitation ullamco fugiat exercitation id sit in eu voluptate.', content: 'Ut dolore mollit nulla nulla sint. Enim proident quis cillum cupidatat reprehenderit minim sunt voluptate. Fugiat ex dolore ullamco anim in aliqua est labore irure eiusmod sunt sint.', - when: moment().subtract(68, 'days'), + when: subDays(new Date(), 68), read: true, starred: true, labels: [], @@ -1837,7 +1838,7 @@ export const inboxMails: Mail[] = [ subject: 'Sunt quis excepteur magna voluptate cupidatat nostrud ad do ut reprehenderit est.', content: 'Anim quis sint labore in ad amet magna sit et. Adipisicing amet proident occaecat et adipisicing consectetur ullamco est tempor. Voluptate irure tempor pariatur magna nostrud officia mollit amet sint est.', - when: moment().subtract(50, 'hours'), + when: subHours(new Date(), 50), read: true, starred: true, labels: [{ name: 'Project X', color: '#03A9F4' }], @@ -1857,7 +1858,7 @@ export const inboxMails: Mail[] = [ subject: 'Nulla aute excepteur labore nostrud dolor.', content: 'Ex sint incididunt excepteur irure nisi in aute. Lorem do id ut et cillum laborum eu occaecat cillum nisi laboris. Enim consectetur anim mollit minim nulla minim mollit laborum labore enim adipisicing enim eiusmod aliqua.', - when: moment().subtract(70, 'minutes'), + when: subMinutes(new Date(), 70), read: false, starred: true, labels: [], @@ -1877,7 +1878,7 @@ export const inboxMails: Mail[] = [ subject: 'Voluptate dolore minim eiusmod Lorem aliquip consequat consequat id non minim nisi aliqua commodo esse.', content: 'Aliquip exercitation qui id elit esse voluptate eu laborum ullamco laboris nulla mollit laboris. Duis veniam excepteur sit nostrud sint nulla. Do tempor ea fugiat eu dolor est tempor dolore id ad laborum officia.', - when: moment().subtract(41, 'minutes'), + when: subMinutes(new Date(), 41), read: false, starred: false, labels: [], @@ -1897,7 +1898,7 @@ export const inboxMails: Mail[] = [ subject: 'Elit aute nostrud culpa nisi esse aliquip.', content: 'Laboris ut dolore exercitation ipsum est cillum duis non commodo reprehenderit aute nisi. Ut laborum dolore ex nulla officia ullamco quis ex ipsum. Do exercitation cillum nulla laborum cupidatat officia fugiat exercitation occaecat cupidatat proident esse incididunt consequat.', - when: moment().subtract(25, 'weeks'), + when: subWeeks(new Date(), 25), read: true, starred: true, labels: [], @@ -1917,7 +1918,7 @@ export const inboxMails: Mail[] = [ subject: 'Anim pariatur amet qui tempor aliquip dolore ut nostrud mollit deserunt esse.', content: 'Consequat aliqua aliquip quis Lorem magna ea occaecat amet consectetur sunt ut incididunt nostrud. Ipsum id nostrud sint officia et in. Lorem proident incididunt pariatur pariatur aliqua dolor velit qui.', - when: moment().subtract(73, 'hours'), + when: subHours(new Date(), 73), read: true, starred: true, labels: [], @@ -1937,7 +1938,7 @@ export const inboxMails: Mail[] = [ subject: 'Est voluptate quis sint nulla cupidatat voluptate irure.', content: 'Pariatur ipsum irure officia anim non irure aliqua cillum aute excepteur ullamco. Voluptate dolor id nostrud dolore reprehenderit fugiat ipsum mollit culpa ex. Minim commodo nulla sunt elit id do eiusmod.', - when: moment().subtract(26, 'weeks'), + when: subWeeks(new Date(), 26), read: true, starred: false, labels: [], @@ -1958,7 +1959,7 @@ export const inboxMails: Mail[] = [ 'Cupidatat nostrud dolore tempor sunt nisi consequat duis quis minim fugiat officia sunt eiusmod consequat.', content: 'Anim esse excepteur mollit irure laboris mollit non ipsum dolor elit. Cupidatat adipisicing ad laborum ea est laborum id do quis. Elit minim exercitation commodo non consectetur.', - when: moment().subtract(55, 'minutes'), + when: subMinutes(new Date(), 55), read: false, starred: false, labels: [{ name: 'Project X', color: '#03A9F4' }, { name: 'Priority', color: '#f44336' }], @@ -1978,7 +1979,7 @@ export const inboxMails: Mail[] = [ subject: 'Laboris do mollit deserunt et laborum et enim.', content: 'Aute enim et incididunt irure consequat fugiat laborum. Aute magna qui do voluptate cillum. Nostrud deserunt cupidatat reprehenderit non duis tempor laboris occaecat nulla aliqua deserunt.', - when: moment().subtract(52, 'hours'), + when: subHours(new Date(), 52), read: true, starred: false, labels: [], diff --git a/libs/widgets/src/lib/demo-data/mail.interface.ts b/libs/widgets/src/lib/demo-data/mail.interface.ts index 4dc4abee0..9dd05b27c 100755 --- a/libs/widgets/src/lib/demo-data/mail.interface.ts +++ b/libs/widgets/src/lib/demo-data/mail.interface.ts @@ -1,5 +1,3 @@ -import { Moment } from 'moment'; - export type InboxGroup = 'primary' | 'social' | 'promotions'; export type InboxType = 'draft' | 'sent' | 'spam' | 'trash' | 'none'; @@ -16,7 +14,7 @@ export class Mail { }; subject?: string; content?: string; - when?: Moment; + when?: Date; read?: boolean; starred?: boolean; labels?: { diff --git a/libs/widgets/src/lib/demo-data/widget-demo-data.ts b/libs/widgets/src/lib/demo-data/widget-demo-data.ts index 0de90cd73..f7e0de685 100755 --- a/libs/widgets/src/lib/demo-data/widget-demo-data.ts +++ b/libs/widgets/src/lib/demo-data/widget-demo-data.ts @@ -1,7 +1,4 @@ -import * as moment from 'moment'; - -const today = moment().minutes(0); -const now = moment(); +import { format, subDays, subMinutes, formatDistance } from 'date-fns/esm'; export const salesChartDemoValues = [ 193, @@ -84,10 +81,7 @@ export const salesChartDemoValues = [ export const salesChartDemoLabels = () => { return salesChartDemoValues .map((value, index) => - today - .clone() - .subtract(index, 'day') - .format('DD/MM'), + format(subDays(subMinutes(new Date(), 0), index), 'dd/MM') ) .reverse(); }; @@ -122,10 +116,7 @@ export const visitsChartDemoValues = [ export const visitsChartDemoLabels = () => { return visitsChartDemoValues .map((value, index) => - today - .clone() - .subtract(index, 'day') - .format('DD/MM'), + format(subDays(subMinutes(new Date(), 0), index), 'dd/MM') ) .reverse(); }; @@ -156,10 +147,7 @@ export const clicksChartDemoValues = [ export const clicksChartDemoLabels = () => { return clicksChartDemoValues .map((value, index) => - today - .clone() - .subtract(index, 'day') - .format('DD/MM'), + format(subDays(subMinutes(new Date(), 0), index), 'dd/MM') ) .reverse(); }; @@ -190,10 +178,7 @@ export const conversionsChartDemoValues = [ export const conversionsChartDemoLabels = () => { return conversionsChartDemoValues .map((value, index) => - today - .clone() - .subtract(index, 'day') - .format('DD/MM'), + format(subDays(subMinutes(new Date(), 0), index), 'dd/MM') ) .reverse(); }; @@ -202,10 +187,7 @@ export const salesSummaryDemoData = { revenue: [6, 4, 8, 3, 10, 8, 4], expenses: export const salesSummaryDemoLabels = () => { return salesSummaryDemoData.revenue .map((value, index) => - today - .clone() - .subtract(index, 'day') - .format('DD/MM'), + format(subDays(subMinutes(new Date(), 0), index), 'dd/MM') ) .reverse(); }; @@ -238,10 +220,7 @@ export const audienceOverviewUsersDemoData = [108, 78, 63, 119, 85, 140, 101]; export const audienceOverviewUsersDemoLabels = () => { return audienceOverviewUsersDemoData .map((value, index) => - today - .clone() - .subtract(index, 'day') - .format('DD/MM'), + format(subDays(subMinutes(new Date(), 0), index), 'dd/MM') ) .reverse(); }; @@ -251,10 +230,7 @@ export const audienceOverviewSessionsDemoData = [125, 43, 87, 150, 120, 100, 164 export const audienceOverviewSessionsDemoLabels = () => { return audienceOverviewSessionsDemoData .map((value, index) => - today - .clone() - .subtract(index, 'day') - .format('DD/MM'), + format(subDays(subMinutes(new Date(), 0), index), 'dd/MM') ) .reverse(); }; @@ -264,10 +240,7 @@ export const audienceOverviewBounceRateDemoData = [5.5, 12.3, 8.4, 7.3, 9.8, 6.6 export const audienceOverviewBounceRateDemoLabels = () => { return audienceOverviewBounceRateDemoData .map((value, index) => - today - .clone() - .subtract(index, 'day') - .format('DD/MM'), + format(subDays(subMinutes(new Date(), 0), index), 'dd/MM') ) .reverse(); }; @@ -277,10 +250,7 @@ export const audienceOverviewSessionDurationDemoData = [125, 43, 87, 150, 120, 1 export const audienceOverviewSessionDurationDemoLabels = () => { return audienceOverviewSessionDurationDemoData .map((value, index) => - today - .clone() - .subtract(index, 'day') - .format('DD/MM'), + format(subDays(subMinutes(new Date(), 0), index), 'dd/MM') ) .reverse(); }; @@ -289,82 +259,52 @@ export const recentSalesTableDemoData = [ { name: 'Apple iPhone 8', price: '$899.99', - timestamp: now - .clone() - .subtract(2, 'minutes') - .fromNow(), + timestamp: formatDistance (subMinutes(new Date(), 2), new Date()) }, { name: 'USB-C Cable', price: '$8.99', - timestamp: now - .clone() - .subtract(6, 'minutes') - .fromNow(), + timestamp: formatDistance (subMinutes(new Date(), 6), new Date()) }, { name: 'Apple MacBook Pro', price: '$1299.99', - timestamp: now - .clone() - .subtract(14, 'minutes') - .fromNow(), + timestamp: formatDistance (subMinutes(new Date(), 14), new Date()) }, { name: 'Samsung Galaxy S9', price: '$799.99', - timestamp: now - .clone() - .subtract(17, 'minutes') - .fromNow(), + timestamp: formatDistance (subMinutes(new Date(), 17), new Date()) }, { name: 'Lightning to USB-C Adapter', price: '$16.99', - timestamp: now - .clone() - .subtract(25, 'minutes') - .fromNow(), + timestamp: formatDistance (subMinutes(new Date(), 25), new Date()) }, { name: 'Samsung Galaxy S8 256GB', price: '$599.99', - timestamp: now - .clone() - .subtract(42, 'minutes') - .fromNow(), + timestamp: formatDistance (subMinutes(new Date(), 42), new Date()) }, { name: 'Apple iPhone X', price: '$1099.99', - timestamp: now - .clone() - .subtract(87, 'minutes') - .fromNow(), + timestamp: formatDistance (subMinutes(new Date(), 87), new Date()) }, { name: 'Apple iPhone 7 128GB', price: '$699.99', - timestamp: now - .clone() - .subtract(97, 'minutes') - .fromNow(), + timestamp: formatDistance (subMinutes(new Date(), 97), new Date()) }, { name: 'Apple Mac Pro', price: '$999.99', - timestamp: now - .clone() - .subtract(104, 'minutes') - .fromNow(), + timestamp: formatDistance (subMinutes(new Date(), 104), new Date()) }, { name: 'Samsung DEX', price: '$54.99', - timestamp: now - .clone() - .subtract(150, 'minutes') - .fromNow(), + timestamp: formatDistance (subMinutes(new Date(), 150), new Date()) }, ]; @@ -423,10 +363,7 @@ export const recentSalesChartDemoValues = [ export const recentSalesChartDemoLabels = () => { return recentSalesChartDemoValues .map((value, index) => - now - .clone() - .subtract(index * 10, 'minutes') - .fromNow(), + formatDistance (subMinutes(new Date(), 10), new Date()) ) .reverse(); };