Browse Source

Don't set null for the timing config.

pull/4331/head
Halil İbrahim Kalkan 6 years ago
parent
commit
75b255f10f
  1. 24
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs

24
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs

@ -188,7 +188,8 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
ThreeLetterIsoLanguageName = CultureInfo.CurrentUICulture.ThreeLetterISOLanguageName,
DateTimeFormat = new DateTimeFormatDto
{
CalendarAlgorithmType = CultureInfo.CurrentUICulture.DateTimeFormat.Calendar.AlgorithmType.ToString(),
CalendarAlgorithmType =
CultureInfo.CurrentUICulture.DateTimeFormat.Calendar.AlgorithmType.ToString(),
DateTimeFormatLong = CultureInfo.CurrentUICulture.DateTimeFormat.LongDatePattern,
ShortDatePattern = CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern,
FullDateTimePattern = CultureInfo.CurrentUICulture.DateTimeFormat.FullDateTimePattern,
@ -238,25 +239,24 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
protected virtual async Task<TimingDto> GetTimingConfigAsync()
{
var result = new TimingDto();
var windowsTimeZoneId = await _settingProvider.GetOrNullAsync(TimingSettingNames.TimeZone);
if (!windowsTimeZoneId.IsNullOrWhiteSpace())
return new TimingDto
{
result.TimeZone = new TimeZone
TimeZone = new TimeZone
{
Windows = new WindowsTimeZone
{
TimeZoneId = windowsTimeZoneId
},
Iana = new IanaTimeZone()
Iana = new IanaTimeZone
{
TimeZoneName = _timezoneProvider.WindowsToIana(windowsTimeZoneId)
TimeZoneName = windowsTimeZoneId.IsNullOrWhiteSpace()
? null
: _timezoneProvider.WindowsToIana(windowsTimeZoneId)
}
};
}
return result;
}
};
}
protected virtual ClockDto GetClockConfig()
@ -267,4 +267,4 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
};
}
}
}
}
Loading…
Cancel
Save