8000 fix datetime format convert with / separator · mmtrucefacts/botbuilder-python@6208c31 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6208c31

Browse files
committed
fix datetime format convert with / separator
1 parent 085f5b4 commit 6208c31

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

libraries/adaptive-expressions/adaptive/expressions/convert_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def change_state(timestamp: datetime, fmt_state, ltoken_buffer):
341341
fmt_state = State.none
342342
ltoken_buffer = ""
343343
elif character == "/":
344-
result += change_state(timestamp, fmt_state, ltoken_buffer) + ":"
344+
result += change_state(timestamp, fmt_state, ltoken_buffer) + "/"
345345
fmt_state = State.none
346346
ltoken_buffer = ""
347347
elif character == r"\`":

libraries/adaptive-expressions/tests/test_expression_parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,8 @@ class ExpressionParserTests(aiounittest.AsyncTestCase):
857857
["formatDateTime('2018-03-15')", "2018-03-15T00:00:00.000Z"],
858858
["formatDateTime(notISOTimestamp)", "2018-03-15T13:00:00.000Z"],
859859
["formatDateTime(notISOTimestamp, 'MM-dd-yy')", "03-15-18"],
860+
["formatDateTime(notISOTimestamp, 'MM/dd/yy')", "03/15/18"],
861+
["formatDateTime(notISOTimestamp, 'MM/dd/yyy')", "03/15/2018"],
860862
["formatDateTime(timestampObj)", "2018-03-15T13:00:00.000Z"],
861863
# formatEpoch
862864
["formatEpoch(unixTimestamp)", "2018-03-15T13:00:00.000Z"],

0 commit comments

Comments
 (0)
0