mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
committed by
Eugenio Romano
parent
53d96679ea
commit
e39a2b149b
@@ -23,7 +23,7 @@ export interface FileInfo {
|
||||
|
||||
export class FileUtils {
|
||||
|
||||
static flattern(folder: any): Promise<FileInfo[]> {
|
||||
static flatten(folder: any): Promise<FileInfo[]> {
|
||||
let reader = folder.createReader();
|
||||
let files: FileInfo[] = [];
|
||||
return new Promise(resolve => {
|
||||
@@ -46,7 +46,7 @@ export class FileUtils {
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return FileUtils.flattern(entry).then(result => {
|
||||
return FileUtils.flatten(entry).then(result => {
|
||||
files.push(...result);
|
||||
});
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ export class MomentDateAdapter extends DateAdapter<Moment> {
|
||||
|
||||
private localeData: any = moment.localeData();
|
||||
|
||||
overrideDisplyaFormat: string;
|
||||
overrideDisplayFormat: string;
|
||||
|
||||
getYear(date: Moment): number {
|
||||
return date.year();
|
||||
@@ -109,7 +109,7 @@ export class MomentDateAdapter extends DateAdapter<Moment> {
|
||||
let m = moment(value, parseFormat, locale, true);
|
||||
if (!m.isValid()) {
|
||||
// use strict parsing because Moment's parser is very forgiving, and this can lead to undesired behavior.
|
||||
m = moment(value, this.overrideDisplyaFormat, locale, true);
|
||||
m = moment(value, this.overrideDisplayFormat, locale, true);
|
||||
}
|
||||
if (m.isValid()) {
|
||||
// if user omits year, it defaults to 2001, so check for that issue.
|
||||
@@ -131,7 +131,7 @@ export class MomentDateAdapter extends DateAdapter<Moment> {
|
||||
|
||||
format(date: Moment, displayFormat: any): string {
|
||||
date = this.clone(date);
|
||||
displayFormat = this.overrideDisplyaFormat ? this.overrideDisplyaFormat : displayFormat;
|
||||
displayFormat = this.overrideDisplayFormat ? this.overrideDisplayFormat : displayFormat;
|
||||
|
||||
if (date && date.format) {
|
||||
return date.format(displayFormat);
|
||||
|
@@ -106,7 +106,7 @@ describe('ObjectUtils', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('shoud overwrite only single property in the object', () => {
|
||||
it('should overwrite only single property in the object', () => {
|
||||
const obj1 = {
|
||||
child: {
|
||||
prop1: 1,
|
||||
|
Reference in New Issue
Block a user