update sunday
This commit is contained in:
@@ -5,7 +5,7 @@ namespace ROLAC.API.Services;
|
||||
public interface IMealAttendanceService
|
||||
{
|
||||
/// <summary>Today's date in the server's local time zone (the church's "current Sunday").</summary>
|
||||
DateOnly Today { get; }
|
||||
DateOnly ServiceDay { get; }
|
||||
|
||||
/// <summary>Returns the counts for <paramref name="date"/>, creating a zeroed row if none exists.</summary>
|
||||
Task<AttendanceCountsDto> GetOrCreateAsync(DateOnly date);
|
||||
|
||||
@@ -12,7 +12,14 @@ public class MealAttendanceService : IMealAttendanceService
|
||||
public MealAttendanceService(AppDbContext db) => _db = db;
|
||||
|
||||
// Server local time is assumed to match the church's local day.
|
||||
public DateOnly Today => DateOnly.FromDateTime(DateTime.Now);
|
||||
public DateOnly ServiceDay
|
||||
{
|
||||
get
|
||||
{
|
||||
var today = DateOnly.FromDateTime(DateTime.Now);
|
||||
return today.AddDays(-(int)today.DayOfWeek);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<AttendanceCountsDto> GetOrCreateAsync(DateOnly date)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user