DATE() and TIME() doesn't accept milliseconds in the date string.
See original GitHub issueTarget Platforms
NodeJS
SDK Version
1.3
Application Name
Microsoft Search results - https://docs.microsoft.com/en-us/microsoftsearch/customize-results-layout
Problem Description
DATE() and TIME() doesn’t accept milliseconds in the date string. Though millisec based date string is parsed perfectly in JS and in .NET
E.g Data - “departureTime”: “2021-09-07T19:28:09.7315703+00:00”, Format - “text”: “{{TIME(${string(reservationFor.departureTime)})}}”, Result - {{TIME(2021-09-07T19:28:09.7315703+00:00)}}
Without the milliseconds in the string it works correctly.
E.g. Data - “arrivalTime”: “2021-09-07T19:28:09+00:00”, Format - “text”: “{{TIME(${string(reservationFor.arrivalTime)})}}”, Result - 12:28 PM
E.g. Data - “createdUtc”: “2021-07-28T09:17:57.234Z”, Format - “text”: “{{TIME(${string(reservationFor.arrivalTime)})}}”, Result - {{TIME(2021-07-28T09:17:57.234Z)}}
Without the milliseconds in the string it works correctly.
E.g. Data - “createdUtc”: “2021-07-28T09:17:57Z”, Format - “text”: “{{TIME(${string(reservationFor.arrivalTime)})}}”, Result - 2:17 AM
Screenshots
Card JSON
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.3",
"speak": "<s>Flight KL0605 to San Fransisco has been delayed.</s><s>It will not leave until 10:10 AM.</s>",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"size": "Small",
"url": "https://adaptivecards.io/content/airplane.png"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Flight Status",
"horizontalAlignment": "Right",
"isSubtle": true,
"wrap": true
},
{
"type": "TextBlock",
"text": "DELAYED",
"horizontalAlignment": "Right",
"spacing": "None",
"size": "Large",
"color": "Attention",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"separator": true,
"spacing": "Medium",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Passengers",
"isSubtle": true,
"weight": "Bolder",
"wrap": true
},
{
"type": "TextBlock",
"text": "${underName.name}",
"spacing": "Small",
"wrap": true
},
{
"type": "TextBlock",
"text": "Jeremy Goldberg",
"spacing": "Small",
"wrap": true
},
{
"type": "TextBlock",
"text": "Evan Litvak",
"spacing": "Small",
"wrap": true
}
]
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"text": "Seat",
"horizontalAlignment": "Right",
"isSubtle": true,
"weight": "Bolder",
"wrap": true
},
{
"type": "TextBlock",
"text": "14A",
"horizontalAlignment": "Right",
"spacing": "Small",
"wrap": true
},
{
"type": "TextBlock",
"text": "14B",
"horizontalAlignment": "Right",
"spacing": "Small",
"wrap": true
},
{
"type": "TextBlock",
"text": "14C",
"horizontalAlignment": "Right",
"spacing": "Small",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"spacing": "Medium",
"separator": true,
"columns": [
{
"type": "Column",
"width": 1,
"items": [
{
"type": "TextBlock",
"text": "Flight",
"isSubtle": true,
"weight": "Bolder",
"wrap": true
},
{
"type": "TextBlock",
"text": "${reservationFor.flightNumber}",
"spacing": "Small",
"wrap": true
}
]
},
{
"type": "Column",
"width": 1,
"items": [
{
"type": "TextBlock",
"text": "Departs",
"isSubtle": true,
"horizontalAlignment": "Center",
"weight": "Bolder",
"wrap": true
},
{
"type": "TextBlock",
"text": "{{TIME(${string(reservationFor.departureTime)})}}",
"color": "Attention",
"weight": "Bolder",
"horizontalAlignment": "Center",
"spacing": "Small",
"wrap": true
}
]
},
{
"type": "Column",
"width": 1,
"items": [
{
"type": "TextBlock",
"text": "Arrives",
"isSubtle": true,
"horizontalAlignment": "Right",
"weight": "Bolder",
"wrap": true
},
{
"type": "TextBlock",
"text": "{{TIME(${string(reservationFor.arrivalTime)})}}",
"color": "Attention",
"horizontalAlignment": "Right",
"weight": "Bolder",
"spacing": "Small",
"wrap": true
}
]
}
]
},
{
"type": "ColumnSet",
"spacing": "Medium",
"separator": true,
"columns": [
{
"type": "Column",
"width": 1,
"items": [
{
"type": "TextBlock",
"text": "${reservationFor.departureAirport.name}",
"isSubtle": true,
"wrap": true
},
{
"type": "TextBlock",
"text": "${reservationFor.departureAirport.iataCode}",
"size": "ExtraLarge",
"color": "Accent",
"spacing": "None",
"wrap": true
}
]
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"text": " ",
"wrap": true
},
{
"type": "Image",
"url": "https://adaptivecards.io/content/airplane.png",
"size": "Small"
}
]
},
{
"type": "Column",
"width": 1,
"items": [
{
"type": "TextBlock",
"text": "${reservationFor.arrivalAirport.name}",
"isSubtle": true,
"horizontalAlignment": "Right",
"wrap": true
},
{
"type": "TextBlock",
"text": "${reservationFor.arrivalAirport.iataCode}",
"horizontalAlignment": "Right",
"size": "ExtraLarge",
"color": "Accent",
"spacing": "None",
"wrap": true
}
]
}
]
}
]
}
SAMPLE DATA JSON
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationId": "RXJ34P",
"reservationStatus": "http://schema.org/ReservationConfirmed",
"passengerPriorityStatus": "Fast Track",
"passengerSequenceNumber": "ABC123",
"securityScreening": "TSA PreCheck",
"underName": {
"@type": "Person",
"name": "Sarah Hum"
},
"reservationFor": {
"@type": "Flight",
"flightNumber": "KL605",
"provider": {
"@type": "Airline",
"name": "KLM",
"iataCode": "KL",
"boardingPolicy": "http://schema.org/ZoneBoardingPolicy"
},
"seller": {
"@type": "Airline",
"name": "KLM",
"iataCode": "KL"
},
"departureAirport": {
"@type": "Airport",
"name": "Amsterdam Airport",
"iataCode": "AMS"
},
"departureTime": "2021-09-07T19:28:09.7315703+00:00",
"arrivalAirport": {
"@type": "Airport",
"name": "San Francisco Airport",
"iataCode": "SFO"
},
"arrivalTime": "2021-09-07T19:28:09+00:00"
}
}
Sample Code Language
No response
Sample Code
Used adaptive card designer - https://adaptivecards.io/designer
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
looks like fractional seconds are part of RFC3339 (see
time-fraction
)I now use
{{DATE(${formatDateTime(duedate,'yyyy-MM-ddTHH:mm:ssZ')})}}
as a workaround to remove the milliseconds