Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion libraries/botframework-expressions/src/builtInFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { EvaluateExpressionDelegate, ExpressionEvaluator, ValidateExpressionDele
import { ExpressionType } from './expressionType';
import { Extensions } from './extensions';
import { TimeZoneConverter } from './timeZoneConverter';
import { convertCSharpDateTimeToMomentJS } from './formatConverter';
import { MemoryInterface, SimpleObjectMemory, ComposedMemory } from './memory';

/**
Expand Down Expand Up @@ -620,7 +621,14 @@ export class BuiltInFunctions {
}

public static timestampFormatter(formatter: string): string {
return formatter.replace(/dd/g, 'DD').replace(/yyyy/g, 'YYYY').replace(/d/g, 'D').replace(/y/g, 'Y');
let result = formatter;
try {
result = convertCSharpDateTimeToMomentJS(formatter);
} catch(e) {
// do nothing
}

return result;
}

public static timeUnitTransformer(duration: number, cSharpStr: string): { duration: number; tsStr: string } {
Expand Down
Loading