🐛 Fix rewind date issue
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
using System.Linq;
|
|
||||||
using DysonNetwork.Shared.Proto;
|
using DysonNetwork.Shared.Proto;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
@@ -13,8 +12,8 @@ public class PassRewindService(AppDatabase db)
|
|||||||
{
|
{
|
||||||
public async Task<RewindEvent> CreateRewindEvent(Guid accountId, int year)
|
public async Task<RewindEvent> CreateRewindEvent(Guid accountId, int year)
|
||||||
{
|
{
|
||||||
var startDate = Instant.FromDateTimeUtc(new DateTime(year - 1, 12, 26));
|
var startDate = new LocalDate(year - 1, 12, 26).AtMidnight().InUtc().ToInstant();
|
||||||
var endDate = Instant.FromDateTimeUtc(new DateTime(year, 12, 26));
|
var endDate = new LocalDate(year, 12, 26).AtMidnight().InUtc().ToInstant();
|
||||||
|
|
||||||
var checkInDates = await db.AccountCheckInResults
|
var checkInDates = await db.AccountCheckInResults
|
||||||
.Where(a => a.CreatedAt >= startDate && a.CreatedAt < endDate)
|
.Where(a => a.CreatedAt >= startDate && a.CreatedAt < endDate)
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ public class SphereRewindServiceGrpc(
|
|||||||
var accountId = Guid.Parse(request.AccountId);
|
var accountId = Guid.Parse(request.AccountId);
|
||||||
var year = request.Year;
|
var year = request.Year;
|
||||||
|
|
||||||
var startDate = Instant.FromDateTimeUtc(new DateTime(year - 1, 12, 26));
|
var startDate = new LocalDate(year - 1, 12, 26).AtMidnight().InUtc().ToInstant();
|
||||||
var endDate = Instant.FromDateTimeUtc(new DateTime(year, 12, 26));
|
var endDate = new LocalDate(year, 12, 26).AtMidnight().InUtc().ToInstant();
|
||||||
|
|
||||||
// Audience data
|
// Audience data
|
||||||
var mostLovedPublisherClue =
|
var mostLovedPublisherClue =
|
||||||
|
|||||||
Reference in New Issue
Block a user