Skip to content

Commit

Permalink
project metadata update
Browse files Browse the repository at this point in the history
  • Loading branch information
radektomasek committed Dec 4, 2016
1 parent 7e3da48 commit c2935bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"Keboola"
],
"author": "Radek Tomasek <[email protected]>",
"license": "ISC",
"license": "NONE",
"bugs": {
"url": "https://github.com/blueskydigital/keboola-ex-ooyala/issues"
},
Expand Down
1 change: 1 addition & 0 deletions src/lib/constants/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file contains default constants of the application.
export const OOYALA_API_URL = 'https://api.ooyala.com';
export const DEFAULT_START_DATE = '2016-01-01';
export const DEFAULT_DATE_MASK = 'YYYY-MM-DD';
export const DEFAULT_PAGE_SIZE = 1000;
export const IS_INCREMENTAL = false;
export const EVENT_ERROR = 'error';
Expand Down
10 changes: 7 additions & 3 deletions src/lib/helpers/keboolaHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ export function parseConfiguration(configObject) {
if (!timeSegment.match(/month|week|day|hour|15min/)) {
reject('Invalid time segment parameter. Only values: "month", "week", "day", "hour" or "15min" are allowed. Check out the documentation for more information');
}
const maximalDate = moment.utc().subtract(1, "days").format("YYYY-MM-DD");
const startDate = configObject.get('parameters:startDate') || DEFAULT_START_DATE;
const endDate = configObject.get('parameters:endDate') || maximalDate;
const maximalDate = moment.utc().subtract(1, "days").format(DEFAULT_DATE_MASK);
const startDate = isUndefined(configObject.get('parameters:startDate')) || isEmpty(configObject.get('parameters:startDate'))
? DEFAULT_START_DATE
: configObject.get('parameters:startDate');
const endDate = isUndefined(configObject.get('parameters:endDate')) || isEmpty(configObject.get('parameters:endDate'))
? maximalDate
: configObject.get('parameters:endDate');

// Verify whether an input date are inserted in proper order.
if (moment(endDate, "YYYY-MM-DD").diff(moment(startDate, "YYYY-MM-DD")) <= 0) {
Expand Down

0 comments on commit c2935bd

Please sign in to comment.