Hi, I've used this to get the last week's work week
{MATH(Subtract|Integer|{DATE(Week)}|1|#0)}
How can I output the work week into 2 digit? Is it by adding another 0? E.g.
{MATH(Subtract|Integer|{DATE(Week)}|1|#00)}
The above code also does not work for first week of the year. If I use the .net code provided by support:
using System;
using System.Globalization;
public class Test
{
public static string GetPreviousWeek()
{
// Gets the Calendar instance associated with a CultureInfo.
CultureInfo myCI = CultureInfo.CurrentCulture;
Calendar myCal = myCI.Calendar;
// Gets the DTFI properties required by GetWeekOfYear.
CalendarWeekRule myCWR = myCI.DateTimeFormat.CalendarWeekRule;
DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
return myCal.GetWeekOfYear(DateTime.Now.Subtract(new TimeSpan(7,0,0,0,0)), myCWR, myFirstDOW).ToString();
}
}
How can I make the output for single digit weeks to double digit?
Thank you.
Edited by user
2020-05-28T03:49:17Z
|
Reason: Not specified