My application, with the back-end in C# and front-end in Angular Materials, features a search screen that allows users to specify date periods using datepickers. However, I have encountered an issue where some users are not in the UK, causing discrepancies with GMT dates. For example, if a user in Germany selects the date 01/01/2017 on the datepicker, my back-end interprets it as 31/12/2016 23:00:00, leading to inaccurate search results.
I am seeking advice on how to address this issue. Ideally, I would like to continue using the Angular Material datepicker while ensuring that the selected date is passed accurately. While I can manually transform the date before sending it by using
moment(myDate).format('MM/DD/YYYY'))
, I have many similar cases and would prefer a more generic solution.