Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feedback title truncation (connects #3936) #4066

Merged
merged 13 commits into from
Sep 30, 2019
Prev Previous commit
Next Next commit
Create parseToObject function
  • Loading branch information
Liew211 authored and paulbert committed Sep 30, 2019
commit 4cf7c766403cf50d4ca3e46ce437d7ae645c403a
14 changes: 14 additions & 0 deletions src/app/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,17 @@ export const twoDigitNumber = (number: number) => `${number.toString().length <
export const addDateAndTime = (date, time) => new Date(date + (Date.parse('1970-01-01T' + time + 'Z') || 0));

export const getClockTime = (time: Date) => `${twoDigitNumber(time.getHours())}:${twoDigitNumber(time.getMinutes())}`;

export const parseToObject = (url: string) => {
const frags = url.split(';');
const obj = {};
if (frags.length > 1) {
const props = [];
const value = [];
for (i = 1; i < frags.length; i++) {
const split = frags[i].split('=');
obj[split[0]] = split[1];
}
}
return obj;
}