Pārlūkot izejas kodu

"today" and "yesterday" time constraint aliases

Source commit: 18f88b37d8490e1079531e034c65ae9e39e5fd60
Martin Prikryl 7 gadi atpakaļ
vecāks
revīzija
ce1ae1099b
1 mainītis faili ar 9 papildinājumiem un 0 dzēšanām
  1. 9 0
      source/core/Common.cpp

+ 9 - 0
source/core/Common.cpp

@@ -1704,6 +1704,15 @@ bool __fastcall TryRelativeStrToDateTime(UnicodeString S, TDateTime & DateTime,
 {
   S = S.Trim();
   int Index = 1;
+  if (SameText(S, L"today"))
+  {
+    S = L"0DS";
+  }
+  else if (SameText(S, L"yesterday"))
+  {
+    S = L"1DS";
+  }
+
   while ((Index <= S.Length()) && IsDigit(S[Index]))
   {
     Index++;