From bb35f2fff47d4486a159059039d4e4f5b2c0e313 Mon Sep 17 00:00:00 2001 From: m365solutioninsights Date: Sat, 14 Sep 2024 21:12:28 +0530 Subject: [PATCH 1/6] Added WorkDay function --- .../Localization/Strings.cs | 1 + .../Texl/BuiltinFunctionsCore.cs | 1 + .../Texl/Builtins/DateTime.cs | 70 +++++++++++++++++- .../Functions/Library.cs | 16 +++++ .../Functions/LibraryDate.cs | 72 +++++++++++++++++++ .../TexlTests.cs | 1 + 6 files changed, 159 insertions(+), 2 deletions(-) diff --git a/src/libraries/Microsoft.PowerFx.Core/Localization/Strings.cs b/src/libraries/Microsoft.PowerFx.Core/Localization/Strings.cs index ebbeeb730f..868009175c 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Localization/Strings.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Localization/Strings.cs @@ -389,6 +389,7 @@ internal static class TexlStrings public static StringGetter DateTimeValueArg2 = (b) => StringResources.Get("DateTimeValueArg2", b); public static StringGetter AboutDateAdd = (b) => StringResources.Get("AboutDateAdd", b); + public static StringGetter AboutWorkday = (b) => StringResources.Get("AboutWorkday", b); public static StringGetter DateAddArg1 = (b) => StringResources.Get("DateAddArg1", b); public static StringGetter DateAddArg2 = (b) => StringResources.Get("DateAddArg2", b); public static StringGetter DateAddArg3 = (b) => StringResources.Get("DateAddArg3", b); diff --git a/src/libraries/Microsoft.PowerFx.Core/Texl/BuiltinFunctionsCore.cs b/src/libraries/Microsoft.PowerFx.Core/Texl/BuiltinFunctionsCore.cs index 5822db9f2f..c05cbfaffc 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Texl/BuiltinFunctionsCore.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Texl/BuiltinFunctionsCore.cs @@ -91,6 +91,7 @@ internal class BuiltinFunctionsCore public static readonly TexlFunction Date = _library.Add(new DateFunction()); public static readonly TexlFunction DateAdd = _library.Add(new DateAddFunction()); public static readonly TexlFunction DateAddT = _library.Add(new DateAddTFunction()); + public static readonly TexlFunction Workday = _library.Add(new WorkdayFunction()); public static readonly TexlFunction DateDiff = _library.Add(new DateDiffFunction()); public static readonly TexlFunction DateDiffT = _library.Add(new DateDiffTFunction()); public static readonly TexlFunction DateTime = _library.Add(new DateTimeFunction()); diff --git a/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs b/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs index 56243875a4..79190be849 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs @@ -621,7 +621,74 @@ public override bool CheckTypes(CheckTypesContext context, TexlNode[] args, DTyp return fValid; } } + + // Workday(timestamp: d, delta: n : d + internal sealed class WorkdayFunction : BuiltinFunction + { + public override bool IsSelfContained => true; + + public WorkdayFunction() + : base("Workday", TexlStrings.AboutWorkday, FunctionCategories.DateTime, DType.DateTime, 0, 2, 3, DType.DateTime, DType.Number) + { + } + + public override IEnumerable GetSignatures() + { + yield return new[] { TexlStrings.DateAddArg1, TexlStrings.DateAddArg2 }; + yield return new[] { TexlStrings.DateAddArg1, TexlStrings.DateAddArg2, TexlStrings.DateAddArg3 }; + } + + public override IEnumerable GetRequiredEnumNames() + { + return new List() { LanguageConstants.TimeUnitEnumString }; + } + + // This method returns true if there are special suggestions for a particular parameter of the function. + public override bool HasSuggestionsForParam(int argumentIndex) + { + Contracts.Assert(argumentIndex >= 0); + + return argumentIndex == 2; + } + + public override bool CheckTypes(CheckTypesContext context, TexlNode[] args, DType[] argTypes, IErrorContainer errors, out DType returnType, out Dictionary nodeToCoercedTypeMap) + { + Contracts.AssertValue(args); + Contracts.AssertAllValues(args); + Contracts.AssertValue(argTypes); + Contracts.Assert(args.Length == argTypes.Length); + Contracts.AssertValue(errors); + Contracts.Assert(MinArity <= args.Length && args.Length <= MaxArity); + + var fValid = base.CheckTypes(context, args, argTypes, errors, out returnType, out nodeToCoercedTypeMap); + Contracts.Assert(returnType == DType.DateTime); + + var type0 = argTypes[0]; + + if (fValid) + { + if (type0.Kind == DKind.Date || type0.Kind == DKind.DateTime) + { + // Arg0 should be a DateTime or Date. + returnType = type0; + } + else if (nodeToCoercedTypeMap != null && nodeToCoercedTypeMap.TryGetValue(args[0], out var coercedType)) + { + // Or a type that can be coerced to it + returnType = coercedType; + } + else + { + fValid = false; + errors.EnsureError(DocumentErrorSeverity.Severe, args[0], TexlStrings.ErrDateExpected); + returnType = ReturnType; + } + } + return fValid; + } + } + // DateDiff(startdate: d, enddate : d, [ unit: TimeUnits ]) : n internal sealed class DateDiffFunction : BuiltinFunction { @@ -630,14 +697,13 @@ internal sealed class DateDiffFunction : BuiltinFunction public override bool HasPreciseErrors => true; public DateDiffFunction() - : base("DateDiff", TexlStrings.AboutDateDiff, FunctionCategories.DateTime, DType.Number, 0, 2, 3, DType.DateTime, DType.DateTime, BuiltInEnums.TimeUnitEnum.FormulaType._type) + : base("DateDiff", TexlStrings.AboutDateDiff, FunctionCategories.DateTime, DType.Number, 0, 2, 2, DType.DateTime, DType.DateTime, BuiltInEnums.TimeUnitEnum.FormulaType._type) { } public override IEnumerable GetSignatures() { yield return new[] { TexlStrings.DateDiffArg1, TexlStrings.DateDiffArg2 }; - yield return new[] { TexlStrings.DateDiffArg1, TexlStrings.DateDiffArg2, TexlStrings.DateDiffArg3 }; } public override bool CheckTypes(CheckTypesContext context, TexlNode[] args, DType[] argTypes, IErrorContainer errors, out DType returnType, out Dictionary nodeToCoercedTypeMap) diff --git a/src/libraries/Microsoft.PowerFx.Interpreter/Functions/Library.cs b/src/libraries/Microsoft.PowerFx.Interpreter/Functions/Library.cs index ab580f2dd0..23f981000f 100644 --- a/src/libraries/Microsoft.PowerFx.Interpreter/Functions/Library.cs +++ b/src/libraries/Microsoft.PowerFx.Interpreter/Functions/Library.cs @@ -470,6 +470,22 @@ static Library() returnBehavior: ReturnBehavior.ReturnBlankIfAnyArgIsBlank, targetFunction: DateAdd) }, + { + BuiltinFunctionsCore.Workday, + StandardErrorHandling( + BuiltinFunctionsCore.Workday.Name, + expandArguments: InsertDefaultValues(outputArgsCount: 3, fillWith: new BlankValue(IRContext.NotInSource(FormulaType.Blank))), + replaceBlankValues: ReplaceBlankWith( + new DateTimeValue(IRContext.NotInSource(FormulaType.DateTime), _epoch), + new NumberValue(IRContext.NotInSource(FormulaType.Number), 0)), + checkRuntimeTypes: ExactSequence( + DateOrTimeOrDateTime, + ExactValueTypeOrBlank, + StringOrOptionSetBackedByString), + checkRuntimeValues: DeferRuntimeValueChecking, + returnBehavior: ReturnBehavior.ReturnBlankIfAnyArgIsBlank, + targetFunction: Workday) + }, { BuiltinFunctionsCore.DateDiff, StandardErrorHandling( diff --git a/src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryDate.cs b/src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryDate.cs index 93b1c842d4..4552a1c491 100644 --- a/src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryDate.cs +++ b/src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryDate.cs @@ -177,6 +177,78 @@ public static FormulaValue DateAdd(EvalVisitor runner, EvalVisitorContext contex } } + public static FormulaValue Workday(EvalVisitor runner, EvalVisitorContext context, IRContext irContext, FormulaValue[] args) + { + var timeZoneInfo = runner.TimeZoneInfo; + + DateTime dateTime = runner.GetNormalizedDateTimeAllowTimeValue(args[0]); + + int delta; + string timeUnit; + + if (args[1] is NumberValue number) + { + delta = (int)number.Value; + timeUnit = "days"; + } + else + { + throw new NotImplementedException(); + } + + var useUtcConversion = NeedToConvertToUtc(runner, dateTime, timeUnit); + + if (useUtcConversion) + { + dateTime = TimeZoneInfo.ConvertTimeToUtc(dateTime, timeZoneInfo); + } + + try + { + // Determine the increment direction (forward or backward) + int increment = delta > 0 ? 1 : -1; + + // Add days until the required number of workdays is reached + while (delta != 0) + { + dateTime = dateTime.AddDays(increment); + + // If the current date is a weekend, continue without decreasing days + if (dateTime.DayOfWeek == DayOfWeek.Saturday || dateTime.DayOfWeek == DayOfWeek.Sunday) + { + continue; + } + + // If it's a valid workday, decrement the days + delta -= increment; + } + + if (useUtcConversion) + { + dateTime = TimeZoneInfo.ConvertTimeFromUtc(dateTime, timeZoneInfo); + } + + dateTime = MakeValidDateTime(runner, dateTime, timeZoneInfo); + + if (irContext.ResultType._type.Kind == Core.Types.DKind.Date) + { + return new DateValue(irContext, dateTime); + } + else if (irContext.ResultType._type.Kind == Core.Types.DKind.Time) + { + return new TimeValue(irContext, dateTime.Subtract(_epoch)); + } + else + { + return new DateTimeValue(irContext, dateTime); + } + } + catch + { + return CommonErrors.ArgumentOutOfRange(irContext); + } + } + private static DateTime MakeValidDateTime(EvalVisitor runner, DateTime dateTime, TimeZoneInfo timeZoneInfo) { return MakeValidDateTime(runner.TimeZoneInfo, dateTime); diff --git a/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs b/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs index 69196a9c9d..d561d360e9 100644 --- a/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs +++ b/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs @@ -93,6 +93,7 @@ public void TexlDateOverloads_Negative(string script) [InlineData("DateAdd(\"2000-01-01\", 1)", "d")] // Coercion on date argument from string [InlineData("DateAdd(45678, 1)", "d")] // Coercion on date argument from number [InlineData("DateAdd(Time(12,34,56), 1)", "T")] // Coercion on date argument from time + [InlineData("Workday(Date(2024,9,13), 9999)", "D")] public void TexlDateAdd(string script, string expectedType) { Assert.True(DType.TryParse(expectedType, out var type)); From 3ce634961166f96cefbbe058e7d66b694bb75c25 Mon Sep 17 00:00:00 2001 From: m365solutioninsights Date: Sun, 15 Sep 2024 22:51:26 +0530 Subject: [PATCH 2/6] Revert Datediff code --- .../Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs b/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs index 79190be849..64b5c373ac 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs @@ -628,14 +628,13 @@ internal sealed class WorkdayFunction : BuiltinFunction public override bool IsSelfContained => true; public WorkdayFunction() - : base("Workday", TexlStrings.AboutWorkday, FunctionCategories.DateTime, DType.DateTime, 0, 2, 3, DType.DateTime, DType.Number) + : base("Workday", TexlStrings.AboutWorkday, FunctionCategories.DateTime, DType.DateTime, 0, 2, 2, DType.DateTime, DType.Number) { } public override IEnumerable GetSignatures() { yield return new[] { TexlStrings.DateAddArg1, TexlStrings.DateAddArg2 }; - yield return new[] { TexlStrings.DateAddArg1, TexlStrings.DateAddArg2, TexlStrings.DateAddArg3 }; } public override IEnumerable GetRequiredEnumNames() @@ -697,13 +696,14 @@ internal sealed class DateDiffFunction : BuiltinFunction public override bool HasPreciseErrors => true; public DateDiffFunction() - : base("DateDiff", TexlStrings.AboutDateDiff, FunctionCategories.DateTime, DType.Number, 0, 2, 2, DType.DateTime, DType.DateTime, BuiltInEnums.TimeUnitEnum.FormulaType._type) + : base("DateDiff", TexlStrings.AboutDateDiff, FunctionCategories.DateTime, DType.Number, 0, 2, 3, DType.DateTime, DType.DateTime, BuiltInEnums.TimeUnitEnum.FormulaType._type) { } public override IEnumerable GetSignatures() { - yield return new[] { TexlStrings.DateDiffArg1, TexlStrings.DateDiffArg2 }; + yield return new[] { TexlStrings.DateDiffArg1, TexlStrings.DateDiffArg2 }; + yield return new[] { TexlStrings.DateDiffArg1, TexlStrings.DateDiffArg2, TexlStrings.DateDiffArg3 }; } public override bool CheckTypes(CheckTypesContext context, TexlNode[] args, DType[] argTypes, IErrorContainer errors, out DType returnType, out Dictionary nodeToCoercedTypeMap) From 47d4fa2af7a9ead6cd0dc752591a0a936c722b0f Mon Sep 17 00:00:00 2001 From: m365solutioninsights Date: Mon, 16 Sep 2024 00:34:56 +0530 Subject: [PATCH 3/6] add the description to Resources.pares: AboutWorkday --- src/strings/PowerFxResources.bg-BG.resx | 4 ++++ src/strings/PowerFxResources.ca-ES.resx | 4 ++++ src/strings/PowerFxResources.cs-CZ.resx | 4 ++++ src/strings/PowerFxResources.da-DK.resx | 4 ++++ src/strings/PowerFxResources.de-DE.resx | 4 ++++ src/strings/PowerFxResources.el-GR.resx | 4 ++++ src/strings/PowerFxResources.en-US.resx | 4 ++++ src/strings/PowerFxResources.es-ES.resx | 4 ++++ src/strings/PowerFxResources.et-EE.resx | 4 ++++ src/strings/PowerFxResources.eu-ES.resx | 4 ++++ src/strings/PowerFxResources.fi-FI.resx | 4 ++++ src/strings/PowerFxResources.fr-FR.resx | 4 ++++ src/strings/PowerFxResources.gl-ES.resx | 4 ++++ src/strings/PowerFxResources.hi-IN.resx | 4 ++++ src/strings/PowerFxResources.hr-HR.resx | 4 ++++ src/strings/PowerFxResources.hu-HU.resx | 4 ++++ src/strings/PowerFxResources.id-ID.resx | 4 ++++ src/strings/PowerFxResources.it-IT.resx | 4 ++++ src/strings/PowerFxResources.ja-JP.resx | 4 ++++ src/strings/PowerFxResources.kk-KZ.resx | 4 ++++ src/strings/PowerFxResources.ko-KR.resx | 4 ++++ src/strings/PowerFxResources.lt-LT.resx | 4 ++++ src/strings/PowerFxResources.lv-LV.resx | 4 ++++ src/strings/PowerFxResources.ms-MY.resx | 4 ++++ src/strings/PowerFxResources.nb-NO.resx | 4 ++++ src/strings/PowerFxResources.nl-NL.resx | 4 ++++ src/strings/PowerFxResources.pl-PL.resx | 4 ++++ src/strings/PowerFxResources.pt-BR.resx | 4 ++++ src/strings/PowerFxResources.pt-PT.resx | 4 ++++ src/strings/PowerFxResources.ro-RO.resx | 4 ++++ src/strings/PowerFxResources.ru-RU.resx | 4 ++++ src/strings/PowerFxResources.sk-SK.resx | 4 ++++ src/strings/PowerFxResources.sl-SI.resx | 4 ++++ src/strings/PowerFxResources.sr-Cyrl-RS.resx | 4 ++++ src/strings/PowerFxResources.sr-Latn-RS.resx | 4 ++++ src/strings/PowerFxResources.sv-SE.resx | 4 ++++ src/strings/PowerFxResources.th-TH.resx | 4 ++++ src/strings/PowerFxResources.tr-TR.resx | 4 ++++ src/strings/PowerFxResources.uk-UA.resx | 4 ++++ src/strings/PowerFxResources.vi-VN.resx | 4 ++++ src/strings/PowerFxResources.zh-CN.resx | 4 ++++ src/strings/PowerFxResources.zh-TW.resx | 4 ++++ 42 files changed, 168 insertions(+) diff --git a/src/strings/PowerFxResources.bg-BG.resx b/src/strings/PowerFxResources.bg-BG.resx index 70177a8fb0..5c83240d67 100644 --- a/src/strings/PowerFxResources.bg-BG.resx +++ b/src/strings/PowerFxResources.bg-BG.resx @@ -2590,6 +2590,10 @@ Добавя указания брой единици към дадена дата. + + + Добавете брой работни дни преди или след дата. + Изчислява разликата между две дати. diff --git a/src/strings/PowerFxResources.ca-ES.resx b/src/strings/PowerFxResources.ca-ES.resx index e25a232b67..d1b32eab24 100644 --- a/src/strings/PowerFxResources.ca-ES.resx +++ b/src/strings/PowerFxResources.ca-ES.resx @@ -2590,6 +2590,10 @@ Afegeix el nombre d'unitats especificat a una data. + + + Afegir el nombre de dies laborables abans o després d’una data. + Calcula la diferència entre dues dates. diff --git a/src/strings/PowerFxResources.cs-CZ.resx b/src/strings/PowerFxResources.cs-CZ.resx index d12a722d28..134e6456ab 100644 --- a/src/strings/PowerFxResources.cs-CZ.resx +++ b/src/strings/PowerFxResources.cs-CZ.resx @@ -2590,6 +2590,10 @@ Přičte ke kalendářnímu datu zadaný počet jednotek. + + + Přidejte počet pracovních dnů před nebo po datu. + Vypočítá rozdíl mezi dvěma kalendářními daty. diff --git a/src/strings/PowerFxResources.da-DK.resx b/src/strings/PowerFxResources.da-DK.resx index a18e447fa1..4c512814d2 100644 --- a/src/strings/PowerFxResources.da-DK.resx +++ b/src/strings/PowerFxResources.da-DK.resx @@ -2590,6 +2590,10 @@ Føj det angivne antal enheder til en dato. + + + Tilføj antal arbejdsdage før eller efter en dato. + Beregn forskellen mellem de to datoer. diff --git a/src/strings/PowerFxResources.de-DE.resx b/src/strings/PowerFxResources.de-DE.resx index c42c4633ae..69f239add7 100644 --- a/src/strings/PowerFxResources.de-DE.resx +++ b/src/strings/PowerFxResources.de-DE.resx @@ -2591,6 +2591,10 @@ Fügt einem Datum die angegebene Anzahl Einheiten hinzu. + + Anzahl der Arbeitstage vor oder nach einem Datum hinzufügen. + + Berechnet die Differenz zwischen zwei Datumswerten. diff --git a/src/strings/PowerFxResources.el-GR.resx b/src/strings/PowerFxResources.el-GR.resx index a569d6ddce..792c9e7b2e 100644 --- a/src/strings/PowerFxResources.el-GR.resx +++ b/src/strings/PowerFxResources.el-GR.resx @@ -2590,6 +2590,10 @@ Προσθέτει τον καθορισμένο αριθμό μονάδων σε μια ημερομηνία. + + + Добавяне на брой работни дни преди или след дата. + Υπολογίζει τη διαφορά μεταξύ δύο ημερομηνιών. diff --git a/src/strings/PowerFxResources.en-US.resx b/src/strings/PowerFxResources.en-US.resx index a01b3fcbdf..b9b99a325d 100644 --- a/src/strings/PowerFxResources.en-US.resx +++ b/src/strings/PowerFxResources.en-US.resx @@ -2591,6 +2591,10 @@ Add the specified number of units to a date. Description of 'DateAdd' function. + + Add number of working days before or after a date. + Description of 'Workday' function. + Calculate the difference between two dates. Description of 'DateDiff' function diff --git a/src/strings/PowerFxResources.es-ES.resx b/src/strings/PowerFxResources.es-ES.resx index 2af30f1bff..4a185e4acf 100644 --- a/src/strings/PowerFxResources.es-ES.resx +++ b/src/strings/PowerFxResources.es-ES.resx @@ -2590,6 +2590,10 @@ Agregue el número especificado de unidades a una fecha. + + + Agregar el número de días hábiles antes o después de una fecha. + Calcule la diferencia entre dos fechas. diff --git a/src/strings/PowerFxResources.et-EE.resx b/src/strings/PowerFxResources.et-EE.resx index 2bb2fd40d5..0e601d50fb 100644 --- a/src/strings/PowerFxResources.et-EE.resx +++ b/src/strings/PowerFxResources.et-EE.resx @@ -2590,6 +2590,10 @@ Lisab kuupäevale määratud arvu ühikuid. + + + Lisage tööpäevade arv enne või pärast kuupäeva. + Arvutab kahe kuupäeva vahelise erinevuse. diff --git a/src/strings/PowerFxResources.eu-ES.resx b/src/strings/PowerFxResources.eu-ES.resx index 8e09e93c58..f14d2f396a 100644 --- a/src/strings/PowerFxResources.eu-ES.resx +++ b/src/strings/PowerFxResources.eu-ES.resx @@ -2590,6 +2590,10 @@ Gehitu zehaztutako unitate kopurua data batean. + + + Gehitu lanegun kopurua data baten aurretik edo ondoren. + Kalkulatu bi daten arteko aldea. diff --git a/src/strings/PowerFxResources.fi-FI.resx b/src/strings/PowerFxResources.fi-FI.resx index 4513f82e41..b77c988c90 100644 --- a/src/strings/PowerFxResources.fi-FI.resx +++ b/src/strings/PowerFxResources.fi-FI.resx @@ -2590,6 +2590,10 @@ Lisää määritetty määrä yksiköitä päivämäärään. + + + Päivämäärää edeltävien tai sen jälkeisten työpäivien määrän lisääminen. + Laske kahden päivämäärän välinen ero. diff --git a/src/strings/PowerFxResources.fr-FR.resx b/src/strings/PowerFxResources.fr-FR.resx index b65d657ab4..d9bd95258b 100644 --- a/src/strings/PowerFxResources.fr-FR.resx +++ b/src/strings/PowerFxResources.fr-FR.resx @@ -2590,6 +2590,10 @@ Ajouter le nombre spécifié d’unités à une date. + + + Ajouter le nombre de jours ouvrables avant ou après une date. + Calculer l’écart entre deux dates. diff --git a/src/strings/PowerFxResources.gl-ES.resx b/src/strings/PowerFxResources.gl-ES.resx index bba621d904..0439adaa8b 100644 --- a/src/strings/PowerFxResources.gl-ES.resx +++ b/src/strings/PowerFxResources.gl-ES.resx @@ -2590,6 +2590,10 @@ Engade o número especificado de unidades a unha data. + + + Engadir número de días laborables antes ou despois dunha data. + Calcule a diferenza entre dúas datas. diff --git a/src/strings/PowerFxResources.hi-IN.resx b/src/strings/PowerFxResources.hi-IN.resx index c9b33d2887..ca5ea8afcb 100644 --- a/src/strings/PowerFxResources.hi-IN.resx +++ b/src/strings/PowerFxResources.hi-IN.resx @@ -2590,6 +2590,10 @@ किसी दिनांक की निर्दिष्ट इकाईयों की संख्या जोड़ता है. + + + तारीख से पहले या बाद में कार्य दिवसों की संख्या जोड़ें. + दो दिनांकों के बीच अंतर की गणना करता है. diff --git a/src/strings/PowerFxResources.hr-HR.resx b/src/strings/PowerFxResources.hr-HR.resx index 1fbde39d93..d5e615edc1 100644 --- a/src/strings/PowerFxResources.hr-HR.resx +++ b/src/strings/PowerFxResources.hr-HR.resx @@ -2590,6 +2590,10 @@ Dodavanje navedenog broja jedinica u datum. + + + Dodajte broj radnih dana prije ili poslije datuma. + Izračun razlike između dva datuma. diff --git a/src/strings/PowerFxResources.hu-HU.resx b/src/strings/PowerFxResources.hu-HU.resx index 788401485c..4c9ea7301a 100644 --- a/src/strings/PowerFxResources.hu-HU.resx +++ b/src/strings/PowerFxResources.hu-HU.resx @@ -2590,6 +2590,10 @@ Hozzáadja a megadott számú egységet egy dátumhoz. + + + Adja meg a munkanapok számát egy dátum előtt vagy után. + Kiszámítja a különbséget két dátum között. diff --git a/src/strings/PowerFxResources.id-ID.resx b/src/strings/PowerFxResources.id-ID.resx index 611ae4ac2d..c33f1bbc6e 100644 --- a/src/strings/PowerFxResources.id-ID.resx +++ b/src/strings/PowerFxResources.id-ID.resx @@ -2590,6 +2590,10 @@ Menambahkan jumlah unit yang ditentukan untuk tanggal. + + + Tambahkan jumlah hari kerja sebelum atau sesudah tanggal. + Menghitung Selisih dua tanggal. diff --git a/src/strings/PowerFxResources.it-IT.resx b/src/strings/PowerFxResources.it-IT.resx index 84eed1060a..f949d6eb8d 100644 --- a/src/strings/PowerFxResources.it-IT.resx +++ b/src/strings/PowerFxResources.it-IT.resx @@ -2590,6 +2590,10 @@ Aggiunge il numero di unità specificato a una data. + + + Aggiungi il numero di giorni lavorativi prima o dopo una data. + Calcola la differenza tra due date. diff --git a/src/strings/PowerFxResources.ja-JP.resx b/src/strings/PowerFxResources.ja-JP.resx index b8ec6c3238..bf2f13903f 100644 --- a/src/strings/PowerFxResources.ja-JP.resx +++ b/src/strings/PowerFxResources.ja-JP.resx @@ -2590,6 +2590,10 @@ 日付に、指定数の単位を追加します。 + + + 日付の前後の稼働日数を追加します。 + 2 つの日付の差を計算します。 diff --git a/src/strings/PowerFxResources.kk-KZ.resx b/src/strings/PowerFxResources.kk-KZ.resx index 1527828161..41ec83aad9 100644 --- a/src/strings/PowerFxResources.kk-KZ.resx +++ b/src/strings/PowerFxResources.kk-KZ.resx @@ -2590,6 +2590,10 @@ Бірліктердің көрсетілген санын күнге қосады. + + + Күннен бұрын немесе кейін жұмыс күндерінің санын қосыңыз. + Екі күн арасындағы аралықты есептеу. diff --git a/src/strings/PowerFxResources.ko-KR.resx b/src/strings/PowerFxResources.ko-KR.resx index fc090c04fb..50669fca4d 100644 --- a/src/strings/PowerFxResources.ko-KR.resx +++ b/src/strings/PowerFxResources.ko-KR.resx @@ -2590,6 +2590,10 @@ 날짜에 지정된 단위 수를 추가합니다. + + + 날짜 전후의 근무일 수를 추가합니다. + 두 날짜 간 차이를 계산합니다. diff --git a/src/strings/PowerFxResources.lt-LT.resx b/src/strings/PowerFxResources.lt-LT.resx index 774609d5f9..ec059e6738 100644 --- a/src/strings/PowerFxResources.lt-LT.resx +++ b/src/strings/PowerFxResources.lt-LT.resx @@ -2590,6 +2590,10 @@ Į datą įtraukti nurodytą vienetų skaičių. + + + Darbo dienų prieš datą arba po jos skaičiaus pridėjimas. + Apskaičiuoti skirtumą tarp dviejų datų. diff --git a/src/strings/PowerFxResources.lv-LV.resx b/src/strings/PowerFxResources.lv-LV.resx index 6f1276da5d..acde86d55e 100644 --- a/src/strings/PowerFxResources.lv-LV.resx +++ b/src/strings/PowerFxResources.lv-LV.resx @@ -2590,6 +2590,10 @@ Pievienojiet norādīto vienību skaitu datumam. + + + Pievienojiet darba dienu skaitu pirms vai pēc datuma. + Aprēķiniet starpību starp diviem datumiem. diff --git a/src/strings/PowerFxResources.ms-MY.resx b/src/strings/PowerFxResources.ms-MY.resx index 3eb843cecc..6f989999ce 100644 --- a/src/strings/PowerFxResources.ms-MY.resx +++ b/src/strings/PowerFxResources.ms-MY.resx @@ -2590,6 +2590,10 @@ Tambahkan bilangan unit yang ditentukan pada tarikh. + + + Tambah bilangan hari bekerja sebelum atau selepas tarikh. + Kira perbezaan antara dua tarikh. diff --git a/src/strings/PowerFxResources.nb-NO.resx b/src/strings/PowerFxResources.nb-NO.resx index 19dc9d047e..70aa947d9c 100644 --- a/src/strings/PowerFxResources.nb-NO.resx +++ b/src/strings/PowerFxResources.nb-NO.resx @@ -2590,6 +2590,10 @@ Legger til det angitte antallet enheter i en dato. + + + Legg til antall arbeidsdager før eller etter en dato. + Beregn forskjellen mellom to datoer. diff --git a/src/strings/PowerFxResources.nl-NL.resx b/src/strings/PowerFxResources.nl-NL.resx index e22d1cc8a3..ffae63c748 100644 --- a/src/strings/PowerFxResources.nl-NL.resx +++ b/src/strings/PowerFxResources.nl-NL.resx @@ -2590,6 +2590,10 @@ Voeg het opgegeven aantal units toe aan een datum. + + + Voeg aantal werkdagen toe voor of na een datum. + Bereken het verschil tussen twee datums. diff --git a/src/strings/PowerFxResources.pl-PL.resx b/src/strings/PowerFxResources.pl-PL.resx index eac8dc127f..53e3229213 100644 --- a/src/strings/PowerFxResources.pl-PL.resx +++ b/src/strings/PowerFxResources.pl-PL.resx @@ -2590,6 +2590,10 @@ Dodaj określoną liczbę jednostek do daty. + + + Dodaj liczbę dni roboczych przed lub po dacie. + Obliczanie różnicy dwóch dat. diff --git a/src/strings/PowerFxResources.pt-BR.resx b/src/strings/PowerFxResources.pt-BR.resx index 11988a5d0a..ca0374a89d 100644 --- a/src/strings/PowerFxResources.pt-BR.resx +++ b/src/strings/PowerFxResources.pt-BR.resx @@ -2590,6 +2590,10 @@ Adiciona o número especificado de unidades a uma data. + + + Adicionar número de dias úteis antes ou depois de uma data. + Calcula a diferença entre duas datas. diff --git a/src/strings/PowerFxResources.pt-PT.resx b/src/strings/PowerFxResources.pt-PT.resx index fa46eebf43..81e3e8161b 100644 --- a/src/strings/PowerFxResources.pt-PT.resx +++ b/src/strings/PowerFxResources.pt-PT.resx @@ -2590,6 +2590,10 @@ Adicione o número de unidades especificado a uma data. + + + Adicionar número de dias úteis antes ou depois de uma data. + Calcule a diferença entre duas datas. diff --git a/src/strings/PowerFxResources.ro-RO.resx b/src/strings/PowerFxResources.ro-RO.resx index b5b2d8b4b8..10f67e8791 100644 --- a/src/strings/PowerFxResources.ro-RO.resx +++ b/src/strings/PowerFxResources.ro-RO.resx @@ -2590,6 +2590,10 @@ Adăugați numărul de unități specificat la o dată. + + + Adăugați numărul de zile lucrătoare înainte sau după o dată. + Calculați diferența dintre două date. diff --git a/src/strings/PowerFxResources.ru-RU.resx b/src/strings/PowerFxResources.ru-RU.resx index fdc66d1895..d021c37c3e 100644 --- a/src/strings/PowerFxResources.ru-RU.resx +++ b/src/strings/PowerFxResources.ru-RU.resx @@ -2590,6 +2590,10 @@ Добавить указанное количество единиц к дате. + + + Добавьте количество рабочих дней до или после даты. + Вычислить разницу между двумя датами. diff --git a/src/strings/PowerFxResources.sk-SK.resx b/src/strings/PowerFxResources.sk-SK.resx index 1204cb17c8..83b0b945ec 100644 --- a/src/strings/PowerFxResources.sk-SK.resx +++ b/src/strings/PowerFxResources.sk-SK.resx @@ -2590,6 +2590,10 @@ Pridá zadaný počet jednotiek do dátumu. + + + Pridajte počet pracovných dní pred alebo po dátume. + Vypočíta rozdiel medzi dvomi dátumami. diff --git a/src/strings/PowerFxResources.sl-SI.resx b/src/strings/PowerFxResources.sl-SI.resx index 4bd3e2bd76..30f433c4ec 100644 --- a/src/strings/PowerFxResources.sl-SI.resx +++ b/src/strings/PowerFxResources.sl-SI.resx @@ -2590,6 +2590,10 @@ Doda določeno število enot datumu. + + + Dodajte število delovnih dni pred ali po datumu. + Izračuna razliko med dvema datumoma. diff --git a/src/strings/PowerFxResources.sr-Cyrl-RS.resx b/src/strings/PowerFxResources.sr-Cyrl-RS.resx index b1ed476515..c9f0da71cf 100644 --- a/src/strings/PowerFxResources.sr-Cyrl-RS.resx +++ b/src/strings/PowerFxResources.sr-Cyrl-RS.resx @@ -2590,6 +2590,10 @@ Додајте наведени број јединица у датум. + + + Додајте број радних дана пре или после датума. + Израчунава разлику између два датума. diff --git a/src/strings/PowerFxResources.sr-Latn-RS.resx b/src/strings/PowerFxResources.sr-Latn-RS.resx index 33fa9c278e..83eb7917c1 100644 --- a/src/strings/PowerFxResources.sr-Latn-RS.resx +++ b/src/strings/PowerFxResources.sr-Latn-RS.resx @@ -2590,6 +2590,10 @@ Dodajte navedeni broj jedinica u datum. + + + Dodajte broj radnih dana pre ili posle datuma. + Izračunava razliku između dva datuma. diff --git a/src/strings/PowerFxResources.sv-SE.resx b/src/strings/PowerFxResources.sv-SE.resx index cd75a57bd5..18cabe8678 100644 --- a/src/strings/PowerFxResources.sv-SE.resx +++ b/src/strings/PowerFxResources.sv-SE.resx @@ -2590,6 +2590,10 @@ Lägg till det angivna antalet enheter till ett datum. + + + Lägg till antal arbetsdagar före eller efter ett datum. + Beräkna skillnaden mellan två datum. diff --git a/src/strings/PowerFxResources.th-TH.resx b/src/strings/PowerFxResources.th-TH.resx index 45ed95b34e..007936ad8e 100644 --- a/src/strings/PowerFxResources.th-TH.resx +++ b/src/strings/PowerFxResources.th-TH.resx @@ -2590,6 +2590,10 @@ เพิ่มตัวเลขของหน่วยที่ระบุไปยังวันที่ + + + เพิ่มจำนวนวันทำงานก่อนหรือหลังวันที่ + คำนวณผลต่างระหว่างวันที่ diff --git a/src/strings/PowerFxResources.tr-TR.resx b/src/strings/PowerFxResources.tr-TR.resx index b697e9e901..2346a9153a 100644 --- a/src/strings/PowerFxResources.tr-TR.resx +++ b/src/strings/PowerFxResources.tr-TR.resx @@ -2590,6 +2590,10 @@ Belirtilen birim sayısını tarihe ekler. + + + Bir tarihten önce veya sonra çalışma günü sayısını ekleyin. + İki tarih arasındaki farkı hesaplar. diff --git a/src/strings/PowerFxResources.uk-UA.resx b/src/strings/PowerFxResources.uk-UA.resx index 1408743697..f0df412a38 100644 --- a/src/strings/PowerFxResources.uk-UA.resx +++ b/src/strings/PowerFxResources.uk-UA.resx @@ -2590,6 +2590,10 @@ Додавання до дати вказаної кількості одиниць вимірювання. + + + Додайте кількість робочих днів до або після дати. + Обчислення різниці між двома датами. diff --git a/src/strings/PowerFxResources.vi-VN.resx b/src/strings/PowerFxResources.vi-VN.resx index 149a0bf00e..8ff1d02b40 100644 --- a/src/strings/PowerFxResources.vi-VN.resx +++ b/src/strings/PowerFxResources.vi-VN.resx @@ -2590,6 +2590,10 @@ Thêm số đơn vị được chỉ định cho một ngày. + + + Thêm số ngày làm việc trước hoặc sau một ngày. + Tính chênh lệch giữa hai ngày. diff --git a/src/strings/PowerFxResources.zh-CN.resx b/src/strings/PowerFxResources.zh-CN.resx index 274070293d..de78e0f184 100644 --- a/src/strings/PowerFxResources.zh-CN.resx +++ b/src/strings/PowerFxResources.zh-CN.resx @@ -2590,6 +2590,10 @@ 向日期添加指定数量的单位。 + + + 添加日期前后的工作日数。 + 计算两个日期之差。 diff --git a/src/strings/PowerFxResources.zh-TW.resx b/src/strings/PowerFxResources.zh-TW.resx index c34aecd7b0..d4bba35f4b 100644 --- a/src/strings/PowerFxResources.zh-TW.resx +++ b/src/strings/PowerFxResources.zh-TW.resx @@ -2590,6 +2590,10 @@ 對日期新增指定的單位數。 + + + 新增日期前後的工作天數。 + 計算兩個日期之間的差異。 From f8b47c2e4f3969753693188d40e7092717ce2c0f Mon Sep 17 00:00:00 2001 From: m365solutioninsights Date: Mon, 16 Sep 2024 01:08:45 +0530 Subject: [PATCH 4/6] Fixing pipeline issue for "Missing parameter description. Please add the following to Resources.pares: AboutWorkday_date" --- src/strings/PowerFxResources.bg-BG.resx | 2 +- src/strings/PowerFxResources.ca-ES.resx | 2 +- src/strings/PowerFxResources.cs-CZ.resx | 2 +- src/strings/PowerFxResources.da-DK.resx | 2 +- src/strings/PowerFxResources.de-DE.resx | 2 +- src/strings/PowerFxResources.el-GR.resx | 2 +- src/strings/PowerFxResources.en-US.resx | 2 +- src/strings/PowerFxResources.es-ES.resx | 2 +- src/strings/PowerFxResources.et-EE.resx | 2 +- src/strings/PowerFxResources.eu-ES.resx | 2 +- src/strings/PowerFxResources.fi-FI.resx | 2 +- src/strings/PowerFxResources.fr-FR.resx | 2 +- src/strings/PowerFxResources.gl-ES.resx | 2 +- src/strings/PowerFxResources.hi-IN.resx | 2 +- src/strings/PowerFxResources.hr-HR.resx | 2 +- src/strings/PowerFxResources.hu-HU.resx | 2 +- src/strings/PowerFxResources.id-ID.resx | 2 +- src/strings/PowerFxResources.it-IT.resx | 2 +- src/strings/PowerFxResources.ja-JP.resx | 2 +- src/strings/PowerFxResources.kk-KZ.resx | 2 +- src/strings/PowerFxResources.ko-KR.resx | 2 +- src/strings/PowerFxResources.lt-LT.resx | 2 +- src/strings/PowerFxResources.lv-LV.resx | 2 +- src/strings/PowerFxResources.ms-MY.resx | 2 +- src/strings/PowerFxResources.nb-NO.resx | 2 +- src/strings/PowerFxResources.nl-NL.resx | 2 +- src/strings/PowerFxResources.pl-PL.resx | 2 +- src/strings/PowerFxResources.pt-BR.resx | 2 +- src/strings/PowerFxResources.pt-PT.resx | 2 +- src/strings/PowerFxResources.ro-RO.resx | 2 +- src/strings/PowerFxResources.ru-RU.resx | 2 +- src/strings/PowerFxResources.sk-SK.resx | 2 +- src/strings/PowerFxResources.sl-SI.resx | 2 +- src/strings/PowerFxResources.sr-Cyrl-RS.resx | 2 +- src/strings/PowerFxResources.sr-Latn-RS.resx | 2 +- src/strings/PowerFxResources.sv-SE.resx | 2 +- src/strings/PowerFxResources.th-TH.resx | 2 +- src/strings/PowerFxResources.tr-TR.resx | 2 +- src/strings/PowerFxResources.uk-UA.resx | 2 +- src/strings/PowerFxResources.vi-VN.resx | 2 +- src/strings/PowerFxResources.zh-CN.resx | 2 +- src/strings/PowerFxResources.zh-TW.resx | 2 +- 42 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/strings/PowerFxResources.bg-BG.resx b/src/strings/PowerFxResources.bg-BG.resx index 5c83240d67..5fc01e8b0a 100644 --- a/src/strings/PowerFxResources.bg-BG.resx +++ b/src/strings/PowerFxResources.bg-BG.resx @@ -2591,7 +2591,7 @@ Добавя указания брой единици към дадена дата. - + Добавете брой работни дни преди или след дата. diff --git a/src/strings/PowerFxResources.ca-ES.resx b/src/strings/PowerFxResources.ca-ES.resx index d1b32eab24..9190585b2d 100644 --- a/src/strings/PowerFxResources.ca-ES.resx +++ b/src/strings/PowerFxResources.ca-ES.resx @@ -2591,7 +2591,7 @@ Afegeix el nombre d'unitats especificat a una data. - + Afegir el nombre de dies laborables abans o després d’una data. diff --git a/src/strings/PowerFxResources.cs-CZ.resx b/src/strings/PowerFxResources.cs-CZ.resx index 134e6456ab..e41b8f5c25 100644 --- a/src/strings/PowerFxResources.cs-CZ.resx +++ b/src/strings/PowerFxResources.cs-CZ.resx @@ -2591,7 +2591,7 @@ Přičte ke kalendářnímu datu zadaný počet jednotek. - + Přidejte počet pracovních dnů před nebo po datu. diff --git a/src/strings/PowerFxResources.da-DK.resx b/src/strings/PowerFxResources.da-DK.resx index 4c512814d2..6a50665619 100644 --- a/src/strings/PowerFxResources.da-DK.resx +++ b/src/strings/PowerFxResources.da-DK.resx @@ -2591,7 +2591,7 @@ Føj det angivne antal enheder til en dato. - + Tilføj antal arbejdsdage før eller efter en dato. diff --git a/src/strings/PowerFxResources.de-DE.resx b/src/strings/PowerFxResources.de-DE.resx index 69f239add7..5373f2b105 100644 --- a/src/strings/PowerFxResources.de-DE.resx +++ b/src/strings/PowerFxResources.de-DE.resx @@ -2591,7 +2591,7 @@ Fügt einem Datum die angegebene Anzahl Einheiten hinzu. - + Anzahl der Arbeitstage vor oder nach einem Datum hinzufügen. diff --git a/src/strings/PowerFxResources.el-GR.resx b/src/strings/PowerFxResources.el-GR.resx index 792c9e7b2e..4c06739726 100644 --- a/src/strings/PowerFxResources.el-GR.resx +++ b/src/strings/PowerFxResources.el-GR.resx @@ -2591,7 +2591,7 @@ Προσθέτει τον καθορισμένο αριθμό μονάδων σε μια ημερομηνία. - + Добавяне на брой работни дни преди или след дата. diff --git a/src/strings/PowerFxResources.en-US.resx b/src/strings/PowerFxResources.en-US.resx index b9b99a325d..14a5c2a0b6 100644 --- a/src/strings/PowerFxResources.en-US.resx +++ b/src/strings/PowerFxResources.en-US.resx @@ -2591,7 +2591,7 @@ Add the specified number of units to a date. Description of 'DateAdd' function. - + Add number of working days before or after a date. Description of 'Workday' function. diff --git a/src/strings/PowerFxResources.es-ES.resx b/src/strings/PowerFxResources.es-ES.resx index 4a185e4acf..472cf8df83 100644 --- a/src/strings/PowerFxResources.es-ES.resx +++ b/src/strings/PowerFxResources.es-ES.resx @@ -2591,7 +2591,7 @@ Agregue el número especificado de unidades a una fecha. - + Agregar el número de días hábiles antes o después de una fecha. diff --git a/src/strings/PowerFxResources.et-EE.resx b/src/strings/PowerFxResources.et-EE.resx index 0e601d50fb..452d99ddd5 100644 --- a/src/strings/PowerFxResources.et-EE.resx +++ b/src/strings/PowerFxResources.et-EE.resx @@ -2591,7 +2591,7 @@ Lisab kuupäevale määratud arvu ühikuid. - + Lisage tööpäevade arv enne või pärast kuupäeva. diff --git a/src/strings/PowerFxResources.eu-ES.resx b/src/strings/PowerFxResources.eu-ES.resx index f14d2f396a..f05fb64f1e 100644 --- a/src/strings/PowerFxResources.eu-ES.resx +++ b/src/strings/PowerFxResources.eu-ES.resx @@ -2591,7 +2591,7 @@ Gehitu zehaztutako unitate kopurua data batean. - + Gehitu lanegun kopurua data baten aurretik edo ondoren. diff --git a/src/strings/PowerFxResources.fi-FI.resx b/src/strings/PowerFxResources.fi-FI.resx index b77c988c90..1df44b4fb7 100644 --- a/src/strings/PowerFxResources.fi-FI.resx +++ b/src/strings/PowerFxResources.fi-FI.resx @@ -2591,7 +2591,7 @@ Lisää määritetty määrä yksiköitä päivämäärään. - + Päivämäärää edeltävien tai sen jälkeisten työpäivien määrän lisääminen. diff --git a/src/strings/PowerFxResources.fr-FR.resx b/src/strings/PowerFxResources.fr-FR.resx index d9bd95258b..b0809fb38a 100644 --- a/src/strings/PowerFxResources.fr-FR.resx +++ b/src/strings/PowerFxResources.fr-FR.resx @@ -2591,7 +2591,7 @@ Ajouter le nombre spécifié d’unités à une date. - + Ajouter le nombre de jours ouvrables avant ou après une date. diff --git a/src/strings/PowerFxResources.gl-ES.resx b/src/strings/PowerFxResources.gl-ES.resx index 0439adaa8b..a44b54fc2a 100644 --- a/src/strings/PowerFxResources.gl-ES.resx +++ b/src/strings/PowerFxResources.gl-ES.resx @@ -2591,7 +2591,7 @@ Engade o número especificado de unidades a unha data. - + Engadir número de días laborables antes ou despois dunha data. diff --git a/src/strings/PowerFxResources.hi-IN.resx b/src/strings/PowerFxResources.hi-IN.resx index ca5ea8afcb..dd2bcdf2fd 100644 --- a/src/strings/PowerFxResources.hi-IN.resx +++ b/src/strings/PowerFxResources.hi-IN.resx @@ -2591,7 +2591,7 @@ किसी दिनांक की निर्दिष्ट इकाईयों की संख्या जोड़ता है. - + तारीख से पहले या बाद में कार्य दिवसों की संख्या जोड़ें. diff --git a/src/strings/PowerFxResources.hr-HR.resx b/src/strings/PowerFxResources.hr-HR.resx index d5e615edc1..45d972ab28 100644 --- a/src/strings/PowerFxResources.hr-HR.resx +++ b/src/strings/PowerFxResources.hr-HR.resx @@ -2591,7 +2591,7 @@ Dodavanje navedenog broja jedinica u datum. - + Dodajte broj radnih dana prije ili poslije datuma. diff --git a/src/strings/PowerFxResources.hu-HU.resx b/src/strings/PowerFxResources.hu-HU.resx index 4c9ea7301a..61c12cd59c 100644 --- a/src/strings/PowerFxResources.hu-HU.resx +++ b/src/strings/PowerFxResources.hu-HU.resx @@ -2591,7 +2591,7 @@ Hozzáadja a megadott számú egységet egy dátumhoz. - + Adja meg a munkanapok számát egy dátum előtt vagy után. diff --git a/src/strings/PowerFxResources.id-ID.resx b/src/strings/PowerFxResources.id-ID.resx index c33f1bbc6e..3f22755af3 100644 --- a/src/strings/PowerFxResources.id-ID.resx +++ b/src/strings/PowerFxResources.id-ID.resx @@ -2591,7 +2591,7 @@ Menambahkan jumlah unit yang ditentukan untuk tanggal. - + Tambahkan jumlah hari kerja sebelum atau sesudah tanggal. diff --git a/src/strings/PowerFxResources.it-IT.resx b/src/strings/PowerFxResources.it-IT.resx index f949d6eb8d..30199b106c 100644 --- a/src/strings/PowerFxResources.it-IT.resx +++ b/src/strings/PowerFxResources.it-IT.resx @@ -2591,7 +2591,7 @@ Aggiunge il numero di unità specificato a una data. - + Aggiungi il numero di giorni lavorativi prima o dopo una data. diff --git a/src/strings/PowerFxResources.ja-JP.resx b/src/strings/PowerFxResources.ja-JP.resx index bf2f13903f..4577d9da84 100644 --- a/src/strings/PowerFxResources.ja-JP.resx +++ b/src/strings/PowerFxResources.ja-JP.resx @@ -2591,7 +2591,7 @@ 日付に、指定数の単位を追加します。 - + 日付の前後の稼働日数を追加します。 diff --git a/src/strings/PowerFxResources.kk-KZ.resx b/src/strings/PowerFxResources.kk-KZ.resx index 41ec83aad9..f5a164ca77 100644 --- a/src/strings/PowerFxResources.kk-KZ.resx +++ b/src/strings/PowerFxResources.kk-KZ.resx @@ -2591,7 +2591,7 @@ Бірліктердің көрсетілген санын күнге қосады. - + Күннен бұрын немесе кейін жұмыс күндерінің санын қосыңыз. diff --git a/src/strings/PowerFxResources.ko-KR.resx b/src/strings/PowerFxResources.ko-KR.resx index 50669fca4d..3bcaa4af3a 100644 --- a/src/strings/PowerFxResources.ko-KR.resx +++ b/src/strings/PowerFxResources.ko-KR.resx @@ -2591,7 +2591,7 @@ 날짜에 지정된 단위 수를 추가합니다. - + 날짜 전후의 근무일 수를 추가합니다. diff --git a/src/strings/PowerFxResources.lt-LT.resx b/src/strings/PowerFxResources.lt-LT.resx index ec059e6738..05c8345c33 100644 --- a/src/strings/PowerFxResources.lt-LT.resx +++ b/src/strings/PowerFxResources.lt-LT.resx @@ -2591,7 +2591,7 @@ Į datą įtraukti nurodytą vienetų skaičių. - + Darbo dienų prieš datą arba po jos skaičiaus pridėjimas. diff --git a/src/strings/PowerFxResources.lv-LV.resx b/src/strings/PowerFxResources.lv-LV.resx index acde86d55e..657e431e6b 100644 --- a/src/strings/PowerFxResources.lv-LV.resx +++ b/src/strings/PowerFxResources.lv-LV.resx @@ -2591,7 +2591,7 @@ Pievienojiet norādīto vienību skaitu datumam. - + Pievienojiet darba dienu skaitu pirms vai pēc datuma. diff --git a/src/strings/PowerFxResources.ms-MY.resx b/src/strings/PowerFxResources.ms-MY.resx index 6f989999ce..27347d9433 100644 --- a/src/strings/PowerFxResources.ms-MY.resx +++ b/src/strings/PowerFxResources.ms-MY.resx @@ -2591,7 +2591,7 @@ Tambahkan bilangan unit yang ditentukan pada tarikh. - + Tambah bilangan hari bekerja sebelum atau selepas tarikh. diff --git a/src/strings/PowerFxResources.nb-NO.resx b/src/strings/PowerFxResources.nb-NO.resx index 70aa947d9c..04fde6d575 100644 --- a/src/strings/PowerFxResources.nb-NO.resx +++ b/src/strings/PowerFxResources.nb-NO.resx @@ -2591,7 +2591,7 @@ Legger til det angitte antallet enheter i en dato. - + Legg til antall arbeidsdager før eller etter en dato. diff --git a/src/strings/PowerFxResources.nl-NL.resx b/src/strings/PowerFxResources.nl-NL.resx index ffae63c748..6eb76f2cb3 100644 --- a/src/strings/PowerFxResources.nl-NL.resx +++ b/src/strings/PowerFxResources.nl-NL.resx @@ -2591,7 +2591,7 @@ Voeg het opgegeven aantal units toe aan een datum. - + Voeg aantal werkdagen toe voor of na een datum. diff --git a/src/strings/PowerFxResources.pl-PL.resx b/src/strings/PowerFxResources.pl-PL.resx index 53e3229213..2d7615c6df 100644 --- a/src/strings/PowerFxResources.pl-PL.resx +++ b/src/strings/PowerFxResources.pl-PL.resx @@ -2591,7 +2591,7 @@ Dodaj określoną liczbę jednostek do daty. - + Dodaj liczbę dni roboczych przed lub po dacie. diff --git a/src/strings/PowerFxResources.pt-BR.resx b/src/strings/PowerFxResources.pt-BR.resx index ca0374a89d..e7130a0b46 100644 --- a/src/strings/PowerFxResources.pt-BR.resx +++ b/src/strings/PowerFxResources.pt-BR.resx @@ -2591,7 +2591,7 @@ Adiciona o número especificado de unidades a uma data. - + Adicionar número de dias úteis antes ou depois de uma data. diff --git a/src/strings/PowerFxResources.pt-PT.resx b/src/strings/PowerFxResources.pt-PT.resx index 81e3e8161b..5b4b1041e2 100644 --- a/src/strings/PowerFxResources.pt-PT.resx +++ b/src/strings/PowerFxResources.pt-PT.resx @@ -2591,7 +2591,7 @@ Adicione o número de unidades especificado a uma data. - + Adicionar número de dias úteis antes ou depois de uma data. diff --git a/src/strings/PowerFxResources.ro-RO.resx b/src/strings/PowerFxResources.ro-RO.resx index 10f67e8791..f1df8f07f4 100644 --- a/src/strings/PowerFxResources.ro-RO.resx +++ b/src/strings/PowerFxResources.ro-RO.resx @@ -2591,7 +2591,7 @@ Adăugați numărul de unități specificat la o dată. - + Adăugați numărul de zile lucrătoare înainte sau după o dată. diff --git a/src/strings/PowerFxResources.ru-RU.resx b/src/strings/PowerFxResources.ru-RU.resx index d021c37c3e..b975ec07dc 100644 --- a/src/strings/PowerFxResources.ru-RU.resx +++ b/src/strings/PowerFxResources.ru-RU.resx @@ -2591,7 +2591,7 @@ Добавить указанное количество единиц к дате. - + Добавьте количество рабочих дней до или после даты. diff --git a/src/strings/PowerFxResources.sk-SK.resx b/src/strings/PowerFxResources.sk-SK.resx index 83b0b945ec..6659db2da9 100644 --- a/src/strings/PowerFxResources.sk-SK.resx +++ b/src/strings/PowerFxResources.sk-SK.resx @@ -2591,7 +2591,7 @@ Pridá zadaný počet jednotiek do dátumu. - + Pridajte počet pracovných dní pred alebo po dátume. diff --git a/src/strings/PowerFxResources.sl-SI.resx b/src/strings/PowerFxResources.sl-SI.resx index 30f433c4ec..b478dfe9f9 100644 --- a/src/strings/PowerFxResources.sl-SI.resx +++ b/src/strings/PowerFxResources.sl-SI.resx @@ -2591,7 +2591,7 @@ Doda določeno število enot datumu. - + Dodajte število delovnih dni pred ali po datumu. diff --git a/src/strings/PowerFxResources.sr-Cyrl-RS.resx b/src/strings/PowerFxResources.sr-Cyrl-RS.resx index c9f0da71cf..c6a6d46698 100644 --- a/src/strings/PowerFxResources.sr-Cyrl-RS.resx +++ b/src/strings/PowerFxResources.sr-Cyrl-RS.resx @@ -2591,7 +2591,7 @@ Додајте наведени број јединица у датум. - + Додајте број радних дана пре или после датума. diff --git a/src/strings/PowerFxResources.sr-Latn-RS.resx b/src/strings/PowerFxResources.sr-Latn-RS.resx index 83eb7917c1..75bd5c43dd 100644 --- a/src/strings/PowerFxResources.sr-Latn-RS.resx +++ b/src/strings/PowerFxResources.sr-Latn-RS.resx @@ -2591,7 +2591,7 @@ Dodajte navedeni broj jedinica u datum. - + Dodajte broj radnih dana pre ili posle datuma. diff --git a/src/strings/PowerFxResources.sv-SE.resx b/src/strings/PowerFxResources.sv-SE.resx index 18cabe8678..7ea5594963 100644 --- a/src/strings/PowerFxResources.sv-SE.resx +++ b/src/strings/PowerFxResources.sv-SE.resx @@ -2591,7 +2591,7 @@ Lägg till det angivna antalet enheter till ett datum. - + Lägg till antal arbetsdagar före eller efter ett datum. diff --git a/src/strings/PowerFxResources.th-TH.resx b/src/strings/PowerFxResources.th-TH.resx index 007936ad8e..b5174aecdd 100644 --- a/src/strings/PowerFxResources.th-TH.resx +++ b/src/strings/PowerFxResources.th-TH.resx @@ -2591,7 +2591,7 @@ เพิ่มตัวเลขของหน่วยที่ระบุไปยังวันที่ - + เพิ่มจำนวนวันทำงานก่อนหรือหลังวันที่ diff --git a/src/strings/PowerFxResources.tr-TR.resx b/src/strings/PowerFxResources.tr-TR.resx index 2346a9153a..75af8d151f 100644 --- a/src/strings/PowerFxResources.tr-TR.resx +++ b/src/strings/PowerFxResources.tr-TR.resx @@ -2591,7 +2591,7 @@ Belirtilen birim sayısını tarihe ekler. - + Bir tarihten önce veya sonra çalışma günü sayısını ekleyin. diff --git a/src/strings/PowerFxResources.uk-UA.resx b/src/strings/PowerFxResources.uk-UA.resx index f0df412a38..60cd533136 100644 --- a/src/strings/PowerFxResources.uk-UA.resx +++ b/src/strings/PowerFxResources.uk-UA.resx @@ -2591,7 +2591,7 @@ Додавання до дати вказаної кількості одиниць вимірювання. - + Додайте кількість робочих днів до або після дати. diff --git a/src/strings/PowerFxResources.vi-VN.resx b/src/strings/PowerFxResources.vi-VN.resx index 8ff1d02b40..675a6eb3fe 100644 --- a/src/strings/PowerFxResources.vi-VN.resx +++ b/src/strings/PowerFxResources.vi-VN.resx @@ -2591,7 +2591,7 @@ Thêm số đơn vị được chỉ định cho một ngày. - + Thêm số ngày làm việc trước hoặc sau một ngày. diff --git a/src/strings/PowerFxResources.zh-CN.resx b/src/strings/PowerFxResources.zh-CN.resx index de78e0f184..36f7a2806e 100644 --- a/src/strings/PowerFxResources.zh-CN.resx +++ b/src/strings/PowerFxResources.zh-CN.resx @@ -2591,7 +2591,7 @@ 向日期添加指定数量的单位。 - + 添加日期前后的工作日数。 diff --git a/src/strings/PowerFxResources.zh-TW.resx b/src/strings/PowerFxResources.zh-TW.resx index d4bba35f4b..17e984c805 100644 --- a/src/strings/PowerFxResources.zh-TW.resx +++ b/src/strings/PowerFxResources.zh-TW.resx @@ -2591,7 +2591,7 @@ 對日期新增指定的單位數。 - + 新增日期前後的工作天數。 From 6aa54e067dd095959a40f682f264046db57e4144 Mon Sep 17 00:00:00 2001 From: m365solutioninsights Date: Mon, 16 Sep 2024 02:07:36 +0530 Subject: [PATCH 5/6] Remove Test case for Workday --- src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs b/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs index d561d360e9..69196a9c9d 100644 --- a/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs +++ b/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs @@ -93,7 +93,6 @@ public void TexlDateOverloads_Negative(string script) [InlineData("DateAdd(\"2000-01-01\", 1)", "d")] // Coercion on date argument from string [InlineData("DateAdd(45678, 1)", "d")] // Coercion on date argument from number [InlineData("DateAdd(Time(12,34,56), 1)", "T")] // Coercion on date argument from time - [InlineData("Workday(Date(2024,9,13), 9999)", "D")] public void TexlDateAdd(string script, string expectedType) { Assert.True(DType.TryParse(expectedType, out var type)); From f95f319db19d64d2293b2871ca41f6d8cc04f69f Mon Sep 17 00:00:00 2001 From: m365solutioninsights Date: Sun, 29 Sep 2024 17:05:48 +0530 Subject: [PATCH 6/6] add a new file Workday.txt and handling blank, error values, unexpected type and coercions in Workday --- .../Localization/Strings.cs | 6 ++- .../Texl/Builtins/DateTime.cs | 25 +++------- .../Functions/Library.cs | 2 +- .../Functions/LibraryDate.cs | 16 ++---- .../ExpressionTestCases/Workday.txt | 50 +++++++++++++++++++ .../TexlTests.cs | 2 + 6 files changed, 67 insertions(+), 34 deletions(-) create mode 100644 src/tests/Microsoft.PowerFx.Core.Tests.Shared/ExpressionTestCases/Workday.txt diff --git a/src/libraries/Microsoft.PowerFx.Core/Localization/Strings.cs b/src/libraries/Microsoft.PowerFx.Core/Localization/Strings.cs index 868009175c..840e877e99 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Localization/Strings.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Localization/Strings.cs @@ -389,11 +389,15 @@ internal static class TexlStrings public static StringGetter DateTimeValueArg2 = (b) => StringResources.Get("DateTimeValueArg2", b); public static StringGetter AboutDateAdd = (b) => StringResources.Get("AboutDateAdd", b); - public static StringGetter AboutWorkday = (b) => StringResources.Get("AboutWorkday", b); public static StringGetter DateAddArg1 = (b) => StringResources.Get("DateAddArg1", b); public static StringGetter DateAddArg2 = (b) => StringResources.Get("DateAddArg2", b); public static StringGetter DateAddArg3 = (b) => StringResources.Get("DateAddArg3", b); + public static StringGetter AboutWorkday = (b) => StringResources.Get("AboutWorkday", b); + public static StringGetter WorkdayArg1 = (b) => StringResources.Get("WorkdayArg1", b); + public static StringGetter WorkdayArg2 = (b) => StringResources.Get("WorkdayArg2", b); + public static StringGetter WorkdayArg3 = (b) => StringResources.Get("WorkdayArg3", b); + public static StringGetter AboutDateAddT = (b) => StringResources.Get("AboutDateAddT", b); public static StringGetter DateAddTArg1 = (b) => StringResources.Get("DateAddTArg1", b); public static StringGetter DateAddTArg2 = (b) => StringResources.Get("DateAddTArg2", b); diff --git a/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs b/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs index 64b5c373ac..571b189fbb 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Texl/Builtins/DateTime.cs @@ -620,9 +620,9 @@ public override bool CheckTypes(CheckTypesContext context, TexlNode[] args, DTyp return fValid; } - } - - // Workday(timestamp: d, delta: n : d + } + + // Workday(timestamp: d, delta: n) : d internal sealed class WorkdayFunction : BuiltinFunction { public override bool IsSelfContained => true; @@ -634,20 +634,7 @@ public WorkdayFunction() public override IEnumerable GetSignatures() { - yield return new[] { TexlStrings.DateAddArg1, TexlStrings.DateAddArg2 }; - } - - public override IEnumerable GetRequiredEnumNames() - { - return new List() { LanguageConstants.TimeUnitEnumString }; - } - - // This method returns true if there are special suggestions for a particular parameter of the function. - public override bool HasSuggestionsForParam(int argumentIndex) - { - Contracts.Assert(argumentIndex >= 0); - - return argumentIndex == 2; + yield return new[] { TexlStrings.WorkdayArg1, TexlStrings.WorkdayArg2 }; } public override bool CheckTypes(CheckTypesContext context, TexlNode[] args, DType[] argTypes, IErrorContainer errors, out DType returnType, out Dictionary nodeToCoercedTypeMap) @@ -666,9 +653,9 @@ public override bool CheckTypes(CheckTypesContext context, TexlNode[] args, DTyp if (fValid) { - if (type0.Kind == DKind.Date || type0.Kind == DKind.DateTime) + if (type0.Kind == DKind.Date || type0.Kind == DKind.DateTime || type0.Kind == DKind.Time) { - // Arg0 should be a DateTime or Date. + // Arg0 should be a Time, DateTime or Date. returnType = type0; } else if (nodeToCoercedTypeMap != null && nodeToCoercedTypeMap.TryGetValue(args[0], out var coercedType)) diff --git a/src/libraries/Microsoft.PowerFx.Interpreter/Functions/Library.cs b/src/libraries/Microsoft.PowerFx.Interpreter/Functions/Library.cs index 23f981000f..fb8217350a 100644 --- a/src/libraries/Microsoft.PowerFx.Interpreter/Functions/Library.cs +++ b/src/libraries/Microsoft.PowerFx.Interpreter/Functions/Library.cs @@ -474,7 +474,7 @@ static Library() BuiltinFunctionsCore.Workday, StandardErrorHandling( BuiltinFunctionsCore.Workday.Name, - expandArguments: InsertDefaultValues(outputArgsCount: 3, fillWith: new BlankValue(IRContext.NotInSource(FormulaType.Blank))), + expandArguments: InsertDefaultValues(outputArgsCount: 2, fillWith: new BlankValue(IRContext.NotInSource(FormulaType.Blank))), replaceBlankValues: ReplaceBlankWith( new DateTimeValue(IRContext.NotInSource(FormulaType.DateTime), _epoch), new NumberValue(IRContext.NotInSource(FormulaType.Number), 0)), diff --git a/src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryDate.cs b/src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryDate.cs index 4552a1c491..702cba068c 100644 --- a/src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryDate.cs +++ b/src/libraries/Microsoft.PowerFx.Interpreter/Functions/LibraryDate.cs @@ -193,7 +193,8 @@ public static FormulaValue Workday(EvalVisitor runner, EvalVisitorContext contex } else { - throw new NotImplementedException(); + //throw new NotImplementedException(); + return CommonErrors.RuntimeTypeMismatch(args[1].IRContext); } var useUtcConversion = NeedToConvertToUtc(runner, dateTime, timeUnit); @@ -230,18 +231,7 @@ public static FormulaValue Workday(EvalVisitor runner, EvalVisitorContext contex dateTime = MakeValidDateTime(runner, dateTime, timeZoneInfo); - if (irContext.ResultType._type.Kind == Core.Types.DKind.Date) - { - return new DateValue(irContext, dateTime); - } - else if (irContext.ResultType._type.Kind == Core.Types.DKind.Time) - { - return new TimeValue(irContext, dateTime.Subtract(_epoch)); - } - else - { - return new DateTimeValue(irContext, dateTime); - } + return new DateValue(irContext, dateTime); } catch { diff --git a/src/tests/Microsoft.PowerFx.Core.Tests.Shared/ExpressionTestCases/Workday.txt b/src/tests/Microsoft.PowerFx.Core.Tests.Shared/ExpressionTestCases/Workday.txt new file mode 100644 index 0000000000..1e369773c3 --- /dev/null +++ b/src/tests/Microsoft.PowerFx.Core.Tests.Shared/ExpressionTestCases/Workday.txt @@ -0,0 +1,50 @@ +>> Workday(Date(2024,9,13), 10) +Date(2024,9,27) + +>> Workday(Date(2024,9,13), -10) +Date(2024,8,30) + +>> Workday(45565,1) +Date(2024,10,1) + +>> Workday(Date(2024,9,30), "true") + + +>> DateAdd(false, 1) +Error 8-13: Invalid argument type (Boolean). Expecting a DateTime value instead. +Error 0-7: The function 'DateAdd' has some invalid arguments. + +>> Workday("false",1) + + +>> Workday([Date(2000,1,1)],1) +Error 8-24: Invalid argument type (Table). Expecting a DateTime value instead. + +Error 0-7: The function 'Workday' has some invalid arguments. +>> Workday(null,1) +Error 8-12: Use of a reserved word that is currently not supported. +Error 8-12: Invalid argument type (Error). Expecting a DateTime value instead. +Error 0-7: The function 'Workday' has some invalid arguments. + +>> Workday(Date(2024,9,30), null) +Error 25-29: Use of a reserved word that is currently not supported. +Error 25-29: Invalid argument type (Error). Expecting a Number value instead. +Error 0-7: The function 'Workday' has some invalid arguments. + +>> Workday(Date(2024,9,30), []) +Error 25-27: Invalid argument type (Table). Expecting a Number value instead. +Error 0-7: The function 'Workday' has some invalid arguments. + +>> Workday(,) +Error 8-9: Unexpected characters. Characters are used in the formula in an unexpected way. +Error 9-10: Unexpected characters. Characters are used in the formula in an unexpected way. +Error 10-10: Unexpected characters. The formula contains 'Eof' where 'ParenClose' is expected. +Error 8-9: Invalid argument type (Error). Expecting a DateTime value instead. +Error 9-10: Invalid argument type (Error). Expecting a Number value instead. +Error 0-7: The function 'Workday' has some invalid arguments. + +>> Workday(DateTimeValue(\"1 Jan 2015\"), 2)) +Error 22-23: Unexpected characters. Characters are used in the formula in an unexpected way. +Error 23-36: Expected operator. We expect an operator such as +, *, or & at this point in the formula. +Error 36-37: Unexpected characters. Characters are used in the formula in an unexpected way. +Error 0-42: Invalid number of arguments: received 1, expected 2. \ No newline at end of file diff --git a/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs b/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs index 69196a9c9d..a8985af698 100644 --- a/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs +++ b/src/tests/Microsoft.PowerFx.Core.Tests.Shared/TexlTests.cs @@ -93,6 +93,8 @@ public void TexlDateOverloads_Negative(string script) [InlineData("DateAdd(\"2000-01-01\", 1)", "d")] // Coercion on date argument from string [InlineData("DateAdd(45678, 1)", "d")] // Coercion on date argument from number [InlineData("DateAdd(Time(12,34,56), 1)", "T")] // Coercion on date argument from time + [InlineData("Workday(Date(2024,9,13),999)", "D")] + [InlineData("Workday(Date(2024,9,13),-101)", "D")] public void TexlDateAdd(string script, string expectedType) { Assert.True(DType.TryParse(expectedType, out var type));