aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index a060e4a2c..b5c218e01 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -1,13 +1,12 @@
-import * as uuid from 'uuid';
import { ColorResult } from 'react-color';
+import * as uuid from 'uuid';
//import { Socket } from '../node_modules/socket.io-client';
-import { Socket } from '../node_modules/socket.io/dist/index';
+import * as Color from 'color';
import * as rp from 'request-promise';
+import { Socket } from '../node_modules/socket.io/dist/index';
import { DocumentType } from './client/documents/DocumentTypes';
import { Colors } from './client/views/global/globalEnums';
import { Message } from './server/Message';
-import * as Color from 'color';
-import { action } from 'mobx';
export namespace Utils {
export let CLICK_TIME = 300;
@@ -896,23 +895,19 @@ export function setupMoveUpEvents(
document.addEventListener('click', _clickEvent, true);
}
-export function dateRangeStrToDates (dateStr: string) {
+export function dateRangeStrToDates(dateStr: string) {
// dateStr in yyyy-mm-dd format
- const dateRangeParts = dateStr.split("|"); // splits into from and to date
- const fromParts = dateRangeParts[0].split("-");
- const toParts = dateRangeParts[1].split("-");
+ const dateRangeParts = dateStr.split('|'); // splits into from and to date
+ const fromParts = dateRangeParts[0].split('-');
+ const toParts = dateRangeParts[1].split('-');
const fromYear = parseInt(fromParts[0]);
- const fromMonth = parseInt(fromParts[1])-1;
+ const fromMonth = parseInt(fromParts[1]) - 1;
const fromDay = parseInt(fromParts[2]);
const toYear = parseInt(toParts[0]);
- const toMonth = parseInt(toParts[1])-1;
+ const toMonth = parseInt(toParts[1]) - 1;
const toDay = parseInt(toParts[2]);
-
- return [
- new Date(fromYear, fromMonth, fromDay),
- new Date(toYear, toMonth, toDay)
- ];
-} \ No newline at end of file
+ return [new Date(fromYear, fromMonth, fromDay), new Date(toYear, toMonth, toDay)];
+}