Datepicker is now working

This commit is contained in:
Maxime Boulay
2025-08-19 20:31:11 +01:00
parent fd652ae936
commit e92967f85f
6 changed files with 64 additions and 39 deletions

View File

@@ -56,7 +56,7 @@ public class PurchaseController : ControllerBase
{
try {
GetUserId();
return Ok(await _purchaseRepository.GetBetweenDate(_userId, DateTime.ParseExact(dateBegin, "dd-MM-yyyy", null), DateTime.ParseExact(dateEnd + " 23:59:59", "dd-MM-yyyy HH:mm:ss", null)));
return Ok(await _purchaseRepository.GetBetweenDate(_userId, DateTime.ParseExact(dateBegin, "dd-MM-yyyy", null).ToLocalTime(), DateTime.ParseExact(dateEnd + " 23:59:59", "dd-MM-yyyy HH:mm:ss", null).ToLocalTime()));
}
catch (Exception ex) {
return StatusCode(500, new { Message = ex.Message });
@@ -68,7 +68,7 @@ public class PurchaseController : ControllerBase
{
try {
GetUserId();
return Ok(await _purchaseRepository.GetCO2BetweenDate(_userId, DateTime.ParseExact(dateBegin, "dd-MM-yyyy", null), DateTime.ParseExact(dateEnd + " 23:59:59", "dd-MM-yyyy HH:mm:ss", null)));
return Ok(await _purchaseRepository.GetCO2BetweenDate(_userId, DateTime.ParseExact(dateBegin, "dd-MM-yyyy", null).ToLocalTime(), DateTime.ParseExact(dateEnd + " 23:59:59", "dd-MM-yyyy HH:mm:ss", null).ToLocalTime()));
}
catch (Exception ex) {
return StatusCode(500, new { Message = ex.Message });