From e2e4fb58c325d5ced6366332443484818634d5ff Mon Sep 17 00:00:00 2001 From: Phillip Martin Date: Thu, 15 Feb 2018 22:16:59 -0800 Subject: [PATCH 1/2] Fixes issue that prevents DateTimeRecognizerExtension from returning Dates without times --- samples/AlarmBot-Cards/DateTimeRecognizerExtensions.cs | 2 +- samples/AlarmBot/DateTimeRecognizerExtensions.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/AlarmBot-Cards/DateTimeRecognizerExtensions.cs b/samples/AlarmBot-Cards/DateTimeRecognizerExtensions.cs index 7925b165a2..91ce798e5f 100644 --- a/samples/AlarmBot-Cards/DateTimeRecognizerExtensions.cs +++ b/samples/AlarmBot-Cards/DateTimeRecognizerExtensions.cs @@ -29,7 +29,7 @@ public static IList GetDateTimes(this BotContext context) return results.Where(result => { var subType = result.TypeName.Split('.').Last(); - return subType.Contains("time") && !subType.Contains("range"); + return (subType.Contains("date") || subType.Contains("time")) && !subType.Contains("range"); }) .Select(result => { diff --git a/samples/AlarmBot/DateTimeRecognizerExtensions.cs b/samples/AlarmBot/DateTimeRecognizerExtensions.cs index 3fce1799e6..8245a88d9d 100644 --- a/samples/AlarmBot/DateTimeRecognizerExtensions.cs +++ b/samples/AlarmBot/DateTimeRecognizerExtensions.cs @@ -28,7 +28,7 @@ public static IList GetDateTimes(this BotContext context) return results.Where(result => { var subType = result.TypeName.Split('.').Last(); - return subType.Contains("time") && !subType.Contains("range"); + return (subType.Contains("date") || subType.Contains("time")) && !subType.Contains("range"); }) .Select(result => { From 4e37f1b4de62bcff33a4f580c01f8d291536bbaf Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 15 Feb 2018 22:21:06 -0800 Subject: [PATCH 2/2] Tests no longer pass after PR #97. The ContextExtension name space changed in the ContextExtensionTests class. --- tests/Microsoft.Bot.Builder.Tests/ContextExtensionTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Microsoft.Bot.Builder.Tests/ContextExtensionTests.cs b/tests/Microsoft.Bot.Builder.Tests/ContextExtensionTests.cs index f5f64369df..e6e93dde12 100644 --- a/tests/Microsoft.Bot.Builder.Tests/ContextExtensionTests.cs +++ b/tests/Microsoft.Bot.Builder.Tests/ContextExtensionTests.cs @@ -4,7 +4,7 @@ using System; using System.Threading.Tasks; using Microsoft.Bot.Builder.Adapters; -using Microsoft.Bot.Builder.ContextExtensions; +using Microsoft.Bot.Builder; using Microsoft.Bot.Schema; using Microsoft.VisualStudio.TestTools.UnitTesting;