This commit is contained in:
Infinite
2020-01-24 16:30:07 +01:00
parent e1a1914d16
commit c2544fee98
37 changed files with 5473 additions and 3182 deletions

View File

@@ -1,6 +1,6 @@
import TextUtils from "./text";
const secondsToString = (seconds : number) => {
const secondsToString = (seconds: number) => {
let ret = TextUtils.secondsToTimestamp(seconds);
if (ret.startsWith("00:")) {
@@ -12,9 +12,9 @@ const secondsToString = (seconds : number) => {
}
return ret;
}
};
const stringToSeconds = (v : string) => {
const stringToSeconds = (v: string) => {
if (!v) {
return 0;
}
@@ -27,7 +27,7 @@ const stringToSeconds = (v : string) => {
let seconds = 0;
let factor = 1;
while(splits.length > 0) {
while (splits.length > 0) {
const thisSplit = splits.pop();
if (thisSplit === undefined) {
return 0;
@@ -43,7 +43,7 @@ const stringToSeconds = (v : string) => {
}
return seconds;
}
};
export default {
secondsToString,

View File

@@ -2,4 +2,4 @@ export { default as ImageUtils } from "./image";
export { default as NavUtils } from "./navigation";
export { default as TableUtils } from "./table";
export { default as TextUtils } from "./text";
export { default as DurationUtils } from './duration';
export { default as DurationUtils } from "./duration";

View File

@@ -55,8 +55,8 @@ const renderInputGroup = (options: {
placeholder?: string;
value: string | undefined;
isEditing: boolean;
asURL?: boolean,
urlPrefix?: string,
asURL?: boolean;
urlPrefix?: string;
onChange: (value: string) => void;
}) => (
<tr>

View File

@@ -42,7 +42,7 @@ const fileNameFromPath = (path: string) => {
return path.replace(/^.*[\\/]/, "");
};
const getAge = (dateString?: string|null, fromDateString?: string) => {
const getAge = (dateString?: string | null, fromDateString?: string) => {
if (!dateString) return 0;
const birthdate = new Date(dateString);