Base solution for your next web application

Activities of "ryan.mennell"

Just bumping this fo visibility.

Thanks for the quick response. Apologies for the delay with mine.

Yes it is hitting and value of abp.timing.timeZoneInfo.iana.timeZoneId is "Europe/London"

Host timezone i set is Default [UTC]. Tenant timezone i set is GMT Standard Time.

Enquiry Date value in tenant database is 2020-05-25 08:00:00.0000000. which will be considered as UTC as i set ClockProviders.UTC.

However, On tenant login > enquiry page > DateTimePicker field > i get same date time "25/05/2020 08:00" if i do not convert it manually with "TimezoneHelper.ConvertFromUtc".

I'm using ASP.NET Core MVC & jQuery Project

Below code works correctly, but i always need to use TimezoneHelper.ConvertFromUtc to convert utc date time from server to Client's set Timezone Date time. If i not convert it then it always shows utc date time as it is from server into datetimepicker.

Is There anything that datetimepicker convert this automatically and display client timezone's datetime without converting it in cshtml views?

I have set ClockProviders.Utc in Configure method of startup.cs file as below:

//Initializes ABP framework.
app.UseAbp(options =>
{
options.UseAbpRequestLocalization = false; //used below: UseAbpRequestLocalization
Clock.Provider = ClockProviders.Utc; // Add the clock setting
});

App/Views/SalesEnquiry/ManageSalesEnquiry.cshtml file

@{
var currentTimezone = await SettingManager.GetSettingValueAsync(TimingSettingNames.TimeZone);
Model.SalesEnquiry.EnquiryDate = TimezoneHelper.ConvertFromUtc(Model.SalesEnquiry.EnquiryDate, currentTimezone).Value;
}
<label>@L("EnquiryDate")</label>@Html.TextBox("EnquiryDate", Model.SalesEnquiry.EnquiryDate, new { @class = "form-control m-input", required = "required", autocomplete = "off" })<span class="input-group-text"><span class="far fa-calendar-alt"></span></span><br>

/ManageSalesEnquiry.js file

$('#EnquiryDate').datetimepicker({
locale: abp.localization.currentLanguage.name,
format: 'L LT'
});
Showing 11 to 13 of 13 entries