public static string GenerateWeekendTimex(DateObject date = default(DateObject))
 {
     if (date.IsDefaultValue())
     {
         return($"{Constants.TimexFuzzyYear}{Constants.DateTimexConnector}{Constants.TimexFuzzyWeek}{Constants.DateTimexConnector}{Constants.TimexWeekend}");
     }
     else
     {
         return($"{DateTimeFormatUtil.ToIsoWeekTimex(date)}{Constants.DateTimexConnector}{Constants.TimexWeekend}");
     }
 }
示例#2
0
 public static string GenerateWeekTimex(DateObject monday = default(DateObject))
 {
     if (monday.IsDefaultValue())
     {
         return($"{Constants.TimexFuzzyYear}{Constants.DateTimexConnector}{Constants.TimexFuzzyWeek}");
     }
     else
     {
         return(DateTimeFormatUtil.ToIsoWeekTimex(monday));
     }
 }
        internal static void ResolveWeekOf(Dictionary <string, object> resolutionDic, string keyName)
        {
            if (resolutionDic.ContainsKey(keyName))
            {
                var resolution = (Dictionary <string, string>)resolutionDic[keyName];

                var monday = DateObject.Parse(resolution[DateTimeResolutionKey.Start], CultureInfo.InvariantCulture);
                resolution[DateTimeResolutionKey.Timex] = DateTimeFormatUtil.ToIsoWeekTimex(monday);

                resolutionDic.Remove(keyName);
                resolutionDic.Add(keyName, resolution);
            }
        }