Exemplo n.º 1
0
 private BarChartData(DateTimeOffset startDate, DateTimeOffset endDate, bool workspaceIsBillable, DateFormat dateFormat, IImmutableList <BarViewModel> bars, int maximumHoursPerBar, IImmutableList <DateTimeOffset> horizontalLegend)
 {
     StartDate           = startDate.ToString(dateFormat.Short, CultureInfo.CurrentCulture);
     EndDate             = endDate.ToString(dateFormat.Short, CultureInfo.CurrentCulture);
     Bars                = bars;
     MaximumHoursPerBar  = maximumHoursPerBar;
     WorkspaceIsBillable = workspaceIsBillable;
     HorizontalLabels    =
         horizontalLegend
         ?.Select(date => new BarChartDayLabel(DateTimeOffsetConversion.ToDayOfWeekInitial(date), date.ToString(dateFormat.Short, CultureInfo.CurrentCulture)))
         .ToImmutableList()
         ?? ImmutableList <BarChartDayLabel> .Empty;
 }
Exemplo n.º 2
0
 private BarChartData(DateTimeOffset startDate, DateTimeOffset endDate, bool workspaceIsBillable, DateFormat dateFormat, BarViewModel[] bars, int maximumHoursPerBar, DateTimeOffset[] horizontalLegend)
 {
     StartDate           = startDate.ToString(dateFormat.Short, CultureInfo.InvariantCulture);
     EndDate             = endDate.ToString(dateFormat.Short, CultureInfo.InvariantCulture);
     Bars                = bars;
     MaximumHoursPerBar  = maximumHoursPerBar;
     WorkspaceIsBillable = workspaceIsBillable;
     if (horizontalLegend != null)
     {
         HorizontalLabels = horizontalLegend
                            .Select(date => new BarChartDayLabel(DateTimeOffsetConversion.ToDayOfWeekInitial(date), date.ToString(dateFormat.Short, CultureInfo.InvariantCulture)))
                            .ToArray();
     }
     else
     {
         HorizontalLabels = new BarChartDayLabel[0];
     }
 }
Exemplo n.º 3
0
 private IEnumerable <UILabel> createHorizontalLegendLabels(IEnumerable <DateTimeOffset> dates, DateFormat format)
 => dates.Select(date =>
                 new BarLegendLabel(
                     DateTimeOffsetConversion.ToDayOfWeekInitial(date),
                     date.ToString(format.Short, CultureInfo.InvariantCulture)));