mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
Merge pull request #33 from nventive/dev/dr/LocalizationPatches
Mixed workaround to get Date calc and Converters to work with Uno
This commit is contained in:
commit
00ecbbf090
11 changed files with 88 additions and 54 deletions
|
@ -55,7 +55,7 @@
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1533" />
|
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1550" />
|
||||||
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.32" />
|
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.32" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Globalization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Windows.ApplicationModel.Resources.Core;
|
using Windows.ApplicationModel.Resources.Core;
|
||||||
using Windows.Globalization;
|
using Windows.Globalization;
|
||||||
|
@ -367,10 +368,11 @@ namespace CalculatorApp.Common
|
||||||
public static DecimalFormatter GetRegionalSettingsAwareDecimalFormatter()
|
public static DecimalFormatter GetRegionalSettingsAwareDecimalFormatter()
|
||||||
{
|
{
|
||||||
IEnumerable<String> languageIdentifiers = GetLanguageIdentifiers();
|
IEnumerable<String> languageIdentifiers = GetLanguageIdentifiers();
|
||||||
if (languageIdentifiers != null)
|
// TODO UNO
|
||||||
{
|
//if (languageIdentifiers != null)
|
||||||
return new DecimalFormatter(languageIdentifiers, GlobalizationPreferences.HomeGeographicRegion);
|
//{
|
||||||
}
|
// return new DecimalFormatter(languageIdentifiers, GlobalizationPreferences.HomeGeographicRegion);
|
||||||
|
//}
|
||||||
|
|
||||||
return new DecimalFormatter();
|
return new DecimalFormatter();
|
||||||
}
|
}
|
||||||
|
@ -400,13 +402,16 @@ namespace CalculatorApp.Common
|
||||||
languageIdentifiers = ApplicationLanguages.Languages;
|
languageIdentifiers = ApplicationLanguages.Languages;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DateTimeFormatter(format, languageIdentifiers, GlobalizationPreferences.HomeGeographicRegion, calendarIdentifier, clockIdentifier);
|
//TODO UNO: return new DateTimeFormatter(format, languageIdentifiers, GlobalizationPreferences.HomeGeographicRegion, calendarIdentifier, clockIdentifier);
|
||||||
|
return new DateTimeFormatter(format, languageIdentifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CurrencyFormatter GetRegionalSettingsAwareCurrencyFormatter()
|
public static CurrencyFormatter GetRegionalSettingsAwareCurrencyFormatter()
|
||||||
{
|
{
|
||||||
string userCurrency =
|
// TOOD UNO
|
||||||
(GlobalizationPreferences.Currencies.Count > 0) ? GlobalizationPreferences.Currencies[0] : DefaultCurrencyCode;
|
//string userCurrency =
|
||||||
|
// (GlobalizationPreferences.Currencies.Count > 0) ? GlobalizationPreferences.Currencies[0] : DefaultCurrencyCode;
|
||||||
|
string userCurrency = DefaultCurrencyCode;
|
||||||
|
|
||||||
IEnumerable<string> languageIdentifiers = GetLanguageIdentifiers();
|
IEnumerable<string> languageIdentifiers = GetLanguageIdentifiers();
|
||||||
if (languageIdentifiers == null)
|
if (languageIdentifiers == null)
|
||||||
|
@ -414,7 +419,8 @@ namespace CalculatorApp.Common
|
||||||
languageIdentifiers = ApplicationLanguages.Languages;
|
languageIdentifiers = ApplicationLanguages.Languages;
|
||||||
}
|
}
|
||||||
|
|
||||||
var currencyFormatter = new CurrencyFormatter(userCurrency, languageIdentifiers, GlobalizationPreferences.HomeGeographicRegion);
|
// TODO UNO: var currencyFormatter = new CurrencyFormatter(userCurrency, languageIdentifiers, GlobalizationPreferences.HomeGeographicRegion);
|
||||||
|
var currencyFormatter = new CurrencyFormatter(userCurrency);
|
||||||
|
|
||||||
int fractionDigits = LocalizationSettings.GetInstance().GetCurrencyTrailingDigits();
|
int fractionDigits = LocalizationSettings.GetInstance().GetCurrencyTrailingDigits();
|
||||||
currencyFormatter.FractionDigits = fractionDigits;
|
currencyFormatter.FractionDigits = fractionDigits;
|
||||||
|
@ -424,7 +430,8 @@ namespace CalculatorApp.Common
|
||||||
|
|
||||||
static IEnumerable<String> GetLanguageIdentifiers()
|
static IEnumerable<String> GetLanguageIdentifiers()
|
||||||
{
|
{
|
||||||
return GlobalizationPreferences.Languages;
|
// TODO UNO: return GlobalizationPreferences.Languages;
|
||||||
|
return new[] { CultureInfo.CurrentCulture.IetfLanguageTag };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resources for the engine use numbers as keys. It's inconvenient, but also difficult to
|
// Resources for the engine use numbers as keys. It's inconvenient, but also difficult to
|
||||||
|
|
|
@ -23,29 +23,34 @@ namespace CalculatorApp
|
||||||
|
|
||||||
public NetworkManager()
|
public NetworkManager()
|
||||||
{
|
{
|
||||||
NetworkInformation.NetworkStatusChanged += new NetworkStatusChangedEventHandler(OnNetworkStatusChange);
|
// TODO: UNO (Not implemented)
|
||||||
|
//NetworkInformation.NetworkStatusChanged += new NetworkStatusChangedEventHandler(OnNetworkStatusChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
~NetworkManager()
|
~NetworkManager()
|
||||||
{
|
{
|
||||||
NetworkInformation.NetworkStatusChanged -= OnNetworkStatusChange;
|
// TODO: UNO (Not implemented)
|
||||||
|
//NetworkInformation.NetworkStatusChanged -= OnNetworkStatusChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NetworkAccessBehavior GetNetworkAccessBehavior()
|
public static NetworkAccessBehavior GetNetworkAccessBehavior()
|
||||||
{
|
{
|
||||||
NetworkAccessBehavior behavior = NetworkAccessBehavior.Offline;
|
// TODO: UNO (Not implemented)
|
||||||
ConnectionProfile connectionProfile = NetworkInformation.GetInternetConnectionProfile();
|
return NetworkAccessBehavior.Normal;
|
||||||
if (connectionProfile != null)
|
|
||||||
{
|
|
||||||
NetworkConnectivityLevel connectivityLevel = connectionProfile.GetNetworkConnectivityLevel();
|
|
||||||
if (connectivityLevel == NetworkConnectivityLevel.InternetAccess || connectivityLevel == NetworkConnectivityLevel.ConstrainedInternetAccess)
|
|
||||||
{
|
|
||||||
ConnectionCost connectionCost = connectionProfile.GetConnectionCost();
|
|
||||||
behavior = ConvertCostInfoToBehavior(connectionCost);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return behavior;
|
//NetworkAccessBehavior behavior = NetworkAccessBehavior.Offline;
|
||||||
|
//ConnectionProfile connectionProfile = NetworkInformation.GetInternetConnectionProfile();
|
||||||
|
//if (connectionProfile != null)
|
||||||
|
//{
|
||||||
|
// NetworkConnectivityLevel connectivityLevel = connectionProfile.GetNetworkConnectivityLevel();
|
||||||
|
// if (connectivityLevel == NetworkConnectivityLevel.InternetAccess || connectivityLevel == NetworkConnectivityLevel.ConstrainedInternetAccess)
|
||||||
|
// {
|
||||||
|
// ConnectionCost connectionCost = connectionProfile.GetConnectionCost();
|
||||||
|
// behavior = ConvertCostInfoToBehavior(connectionCost);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//return behavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnNetworkStatusChange(object sender)
|
void OnNetworkStatusChange(object sender)
|
||||||
|
|
|
@ -21,6 +21,7 @@ using SelectedUnits = System.Collections.Generic.KeyValuePair<string, string>;
|
||||||
using CategorySelectionInitializer = System.Tuple<CalculatorApp.CalculatorList<UnitConversionManager.Unit>, UnitConversionManager.Unit, UnitConversionManager.Unit>;
|
using CategorySelectionInitializer = System.Tuple<CalculatorApp.CalculatorList<UnitConversionManager.Unit>, UnitConversionManager.Unit, UnitConversionManager.Unit>;
|
||||||
using UnitToUnitToConversionDataMap = System.Collections.Generic.Dictionary<UnitConversionManager.Unit, System.Collections.Generic.Dictionary<UnitConversionManager.Unit, UnitConversionManager.ConversionData>>;
|
using UnitToUnitToConversionDataMap = System.Collections.Generic.Dictionary<UnitConversionManager.Unit, System.Collections.Generic.Dictionary<UnitConversionManager.Unit, UnitConversionManager.ConversionData>>;
|
||||||
using CategoryToUnitVectorMap = System.Collections.Generic.Dictionary<UnitConversionManager.Category, CalculatorApp.CalculatorList<UnitConversionManager.Unit>>;
|
using CategoryToUnitVectorMap = System.Collections.Generic.Dictionary<UnitConversionManager.Category, CalculatorApp.CalculatorList<UnitConversionManager.Unit>>;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace CalculatorApp.ViewModel
|
namespace CalculatorApp.ViewModel
|
||||||
{
|
{
|
||||||
|
@ -140,10 +141,12 @@ namespace CalculatorApp.ViewModel
|
||||||
this.m_meteredOverrideSet = false;
|
this.m_meteredOverrideSet = false;
|
||||||
|
|
||||||
|
|
||||||
if (GlobalizationPreferences.Languages.Count > 0)
|
// TODO UNO
|
||||||
{
|
//if (GlobalizationPreferences.Languages.Count > 0)
|
||||||
m_responseLanguage = GlobalizationPreferences.Languages[0];
|
//{
|
||||||
}
|
// m_responseLanguage = GlobalizationPreferences.Languages[0];
|
||||||
|
//}
|
||||||
|
m_responseLanguage = CultureInfo.CurrentCulture.IetfLanguageTag;
|
||||||
|
|
||||||
if (m_client != null)
|
if (m_client != null)
|
||||||
{
|
{
|
||||||
|
@ -151,11 +154,13 @@ namespace CalculatorApp.ViewModel
|
||||||
m_client.SetResponseLanguage(m_responseLanguage);
|
m_client.SetResponseLanguage(m_responseLanguage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CoreWindow.GetForCurrentThread() != null)
|
// TODO UNO
|
||||||
{
|
//if (CoreWindow.GetForCurrentThread() != null)
|
||||||
// Must have a CoreWindow to access the resource context.
|
//{
|
||||||
m_isRtlLanguage = LocalizationService.GetInstance().IsRtlLayout();
|
// // Must have a CoreWindow to access the resource context.
|
||||||
}
|
// m_isRtlLanguage = LocalizationService.GetInstance().IsRtlLayout();
|
||||||
|
//}
|
||||||
|
m_isRtlLanguage = true;
|
||||||
|
|
||||||
m_ratioFormatter = LocalizationService.GetRegionalSettingsAwareDecimalFormatter();
|
m_ratioFormatter = LocalizationService.GetRegionalSettingsAwareDecimalFormatter();
|
||||||
m_ratioFormatter.IsGrouped = true;
|
m_ratioFormatter.IsGrouped = true;
|
||||||
|
@ -311,7 +316,8 @@ namespace CalculatorApp.ViewModel
|
||||||
double rounded = (int)(ratio * (int)(scale)) / scale;
|
double rounded = (int)(ratio * (int)(scale)) / scale;
|
||||||
|
|
||||||
string digitSymbol = LocalizationSettings.GetInstance().GetDigitSymbolFromEnUsDigit('1').ToString();
|
string digitSymbol = LocalizationSettings.GetInstance().GetDigitSymbolFromEnUsDigit('1').ToString();
|
||||||
string roundedFormat = m_ratioFormatter.Format(rounded);
|
// TODO UNO: string roundedFormat = m_ratioFormatter.Format(rounded);
|
||||||
|
string roundedFormat = rounded.ToString(CultureInfo.CurrentCulture);
|
||||||
|
|
||||||
string ratioString = LocalizationStringUtil.GetLocalizedString(
|
string ratioString = LocalizationStringUtil.GetLocalizedString(
|
||||||
m_ratioFormat,
|
m_ratioFormat,
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Windows.Globalization;
|
using Windows.Globalization;
|
||||||
|
@ -114,7 +115,9 @@ namespace CalculatorApp.ViewModel
|
||||||
|
|
||||||
public UnitConverterDataLoader(GeographicRegion region)
|
public UnitConverterDataLoader(GeographicRegion region)
|
||||||
{
|
{
|
||||||
m_currentRegionCode = region.CodeTwoLetter;
|
// TODO UNO
|
||||||
|
//m_currentRegionCode = region.CodeTwoLetter;
|
||||||
|
m_currentRegionCode = new RegionInfo(CultureInfo.CurrentCulture.LCID).TwoLetterISORegionName;
|
||||||
|
|
||||||
m_categoryList = new CalculatorList<UCM.Category>();
|
m_categoryList = new CalculatorList<UCM.Category>();
|
||||||
m_categoryToUnits = new CategoryToUnitVectorMap(EqualityComparer<UCM.Category>.Default);
|
m_categoryToUnits = new CategoryToUnitVectorMap(EqualityComparer<UCM.Category>.Default);
|
||||||
|
|
|
@ -13,6 +13,7 @@ using CalculatorApp.Common.DateCalculation;
|
||||||
using Windows.Foundation;
|
using Windows.Foundation;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using CalculatorApp;
|
using CalculatorApp;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace CalculatorApp.ViewModel
|
namespace CalculatorApp.ViewModel
|
||||||
{
|
{
|
||||||
|
@ -70,7 +71,7 @@ namespace CalculatorApp.ViewModel
|
||||||
m_dateCalcEngine = new DateCalculationEngine(localizationSettings.GetCalendarIdentifier());
|
m_dateCalcEngine = new DateCalculationEngine(localizationSettings.GetCalendarIdentifier());
|
||||||
|
|
||||||
// Initialize dates of DatePicker controls to today's date
|
// Initialize dates of DatePicker controls to today's date
|
||||||
var calendar = new Calendar();
|
var calendar = new Windows.Globalization.Calendar();
|
||||||
var today = calendar.GetDateTime().DateTime;
|
var today = calendar.GetDateTime().DateTime;
|
||||||
|
|
||||||
// FromDate and ToDate should be clipped (adjusted to a consistent hour in UTC)
|
// FromDate and ToDate should be clipped (adjusted to a consistent hour in UTC)
|
||||||
|
@ -126,7 +127,7 @@ namespace CalculatorApp.ViewModel
|
||||||
PropertyChanged += (snd, e) => ((DateCalculatorViewModel)snd).OnPropertyChanged(e.PropertyName);
|
PropertyChanged += (snd, e) => ((DateCalculatorViewModel)snd).OnPropertyChanged(e.PropertyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CheckClipTimeSameDay(Calendar reference)
|
static void CheckClipTimeSameDay(Windows.Globalization.Calendar reference)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -473,7 +474,8 @@ namespace CalculatorApp.ViewModel
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Display the resulting date in long format
|
// Display the resulting date in long format
|
||||||
StrDateResult = m_dateTimeFormatter.Format(DateResult);
|
//TODO UNO: StrDateResult = m_dateTimeFormatter.Format(DateResult);
|
||||||
|
StrDateResult = DateResult.ToString(CultureInfo.CurrentCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -637,7 +639,7 @@ namespace CalculatorApp.ViewModel
|
||||||
|
|
||||||
private static DateTime ClipTime(DateTime dateTime)
|
private static DateTime ClipTime(DateTime dateTime)
|
||||||
{
|
{
|
||||||
var calendar = new Calendar();
|
var calendar = new Windows.Globalization.Calendar();
|
||||||
calendar.SetDateTime(dateTime);
|
calendar.SetDateTime(dateTime);
|
||||||
calendar.Period = 1;
|
calendar.Period = 1;
|
||||||
calendar.Hour = 12;
|
calendar.Hour = 12;
|
||||||
|
|
|
@ -29,6 +29,7 @@ using UCM = UnitConversionManager;
|
||||||
using CategorySelectionInitializer = System.Tuple<CalculatorApp.CalculatorList<UnitConversionManager.Unit>, UnitConversionManager.Unit, UnitConversionManager.Unit>;
|
using CategorySelectionInitializer = System.Tuple<CalculatorApp.CalculatorList<UnitConversionManager.Unit>, UnitConversionManager.Unit, UnitConversionManager.Unit>;
|
||||||
using UnitToUnitToConversionDataMap = System.Collections.Generic.Dictionary<UnitConversionManager.Unit, System.Collections.Generic.Dictionary<UnitConversionManager.Unit, UnitConversionManager.ConversionData>>;
|
using UnitToUnitToConversionDataMap = System.Collections.Generic.Dictionary<UnitConversionManager.Unit, System.Collections.Generic.Dictionary<UnitConversionManager.Unit, UnitConversionManager.ConversionData>>;
|
||||||
using CategoryToUnitVectorMap = System.Collections.Generic.Dictionary<UnitConversionManager.Category, CalculatorApp.CalculatorList<UnitConversionManager.Unit>>;
|
using CategoryToUnitVectorMap = System.Collections.Generic.Dictionary<UnitConversionManager.Category, CalculatorApp.CalculatorList<UnitConversionManager.Unit>>;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace CalculatorApp.ViewModel
|
namespace CalculatorApp.ViewModel
|
||||||
{
|
{
|
||||||
|
@ -885,7 +886,8 @@ namespace CalculatorApp.ViewModel
|
||||||
m_currencyFormatter.IsGrouped = true;
|
m_currencyFormatter.IsGrouped = true;
|
||||||
m_currencyFormatter.Mode = CurrencyFormatterMode.UseCurrencyCode;
|
m_currencyFormatter.Mode = CurrencyFormatterMode.UseCurrencyCode;
|
||||||
m_currencyFormatter.ApplyRoundingForCurrency(RoundingAlgorithm.RoundHalfDown);
|
m_currencyFormatter.ApplyRoundingForCurrency(RoundingAlgorithm.RoundHalfDown);
|
||||||
m_currencyMaxFractionDigits = m_currencyFormatter.FractionDigits;
|
//TODO UNO: m_currencyMaxFractionDigits = m_currencyFormatter.FractionDigits;
|
||||||
|
m_currencyMaxFractionDigits = 2;
|
||||||
|
|
||||||
var resourceLoader = AppResourceProvider.GetInstance();
|
var resourceLoader = AppResourceProvider.GetInstance();
|
||||||
m_localizedValueFromFormat = resourceLoader.GetResourceString(UnitConverterResourceKeys.ValueFromFormat);
|
m_localizedValueFromFormat = resourceLoader.GetResourceString(UnitConverterResourceKeys.ValueFromFormat);
|
||||||
|
@ -1086,8 +1088,11 @@ namespace CalculatorApp.ViewModel
|
||||||
|
|
||||||
if (IsCurrencyCurrentCategory)
|
if (IsCurrencyCurrentCategory)
|
||||||
{
|
{
|
||||||
string currencyResult = m_currencyFormatter.Format(System.Convert.ToDouble(stringToLocalize));
|
// TODO UNO:
|
||||||
string currencyCode = m_currencyFormatter.Currency;
|
// string currencyResult = m_currencyFormatter.Format(System.Convert.ToDouble(stringToLocalize));
|
||||||
|
// string currencyCode = m_currencyFormatter.Currency;
|
||||||
|
string currencyResult = System.Convert.ToDouble(stringToLocalize).ToString(CultureInfo.CurrentCulture);
|
||||||
|
string currencyCode = "TODO UNO";
|
||||||
|
|
||||||
// CurrencyFormatter always includes LangCode or Symbol. Make it include LangCode
|
// CurrencyFormatter always includes LangCode or Symbol. Make it include LangCode
|
||||||
// because this includes a non-breaking space. Remove the LangCode.
|
// because this includes a non-breaking space. Remove the LangCode.
|
||||||
|
@ -1105,7 +1110,9 @@ namespace CalculatorApp.ViewModel
|
||||||
{
|
{
|
||||||
// Convert the input string to double using stod
|
// Convert the input string to double using stod
|
||||||
// Then use the decimalFormatter to reformat the double to Platform String
|
// Then use the decimalFormatter to reformat the double to Platform String
|
||||||
result = m_decimalFormatter.Format(System.Convert.ToDouble(stringToLocalize));
|
// TODO UNO
|
||||||
|
//result = m_decimalFormatter.Format(System.Convert.ToDouble(stringToLocalize));
|
||||||
|
result = System.Convert.ToDouble(stringToLocalize).ToString(CultureInfo.CurrentCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasDecimal)
|
if (hasDecimal)
|
||||||
|
@ -1113,7 +1120,9 @@ namespace CalculatorApp.ViewModel
|
||||||
// Since the output from GetLocaleInfoEx() and DecimalFormatter are differing for decimal string
|
// Since the output from GetLocaleInfoEx() and DecimalFormatter are differing for decimal string
|
||||||
// we are adding the below work-around of editing the string returned by DecimalFormatter
|
// we are adding the below work-around of editing the string returned by DecimalFormatter
|
||||||
// and replacing the decimal separator with the one returned by GetLocaleInfoEx()
|
// and replacing the decimal separator with the one returned by GetLocaleInfoEx()
|
||||||
String formattedSampleString = m_decimalFormatter.Format(System.Convert.ToDouble("1.1"));
|
// TODO UNO
|
||||||
|
//String formattedSampleString = m_decimalFormatter.Format(System.Convert.ToDouble("1.1"));
|
||||||
|
String formattedSampleString = 1.1.ToString(CultureInfo.CurrentCulture);
|
||||||
string formattedSampleWString = formattedSampleString;
|
string formattedSampleWString = formattedSampleString;
|
||||||
|
|
||||||
string resultWithDecimal = result;
|
string resultWithDecimal = result;
|
||||||
|
|
|
@ -14,6 +14,7 @@ using Windows.UI.Xaml.Automation.Peers;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using CalculatorApp.Common;
|
using CalculatorApp.Common;
|
||||||
using CalculatorApp.ViewModel;
|
using CalculatorApp.ViewModel;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
||||||
|
|
||||||
|
@ -50,7 +51,7 @@ namespace CalculatorApp
|
||||||
DateDiff_ToDate.Language = localizationSettings.GetLocaleName();
|
DateDiff_ToDate.Language = localizationSettings.GetLocaleName();
|
||||||
|
|
||||||
// Set Min and Max Dates according to the Gregorian Calendar(1601 & 9999)
|
// Set Min and Max Dates according to the Gregorian Calendar(1601 & 9999)
|
||||||
var calendar = new Calendar();
|
var calendar = new Windows.Globalization.Calendar();
|
||||||
var today = calendar.GetDateTime();
|
var today = calendar.GetDateTime();
|
||||||
|
|
||||||
calendar.ChangeCalendarSystem(CalendarIdentifiers.Gregorian);
|
calendar.ChangeCalendarSystem(CalendarIdentifiers.Gregorian);
|
||||||
|
@ -77,7 +78,8 @@ namespace CalculatorApp
|
||||||
DateDiff_FromDate.DateFormat = "day month year";
|
DateDiff_FromDate.DateFormat = "day month year";
|
||||||
DateDiff_ToDate.DateFormat = "day month year";
|
DateDiff_ToDate.DateFormat = "day month year";
|
||||||
|
|
||||||
var placeholderText = dateTimeFormatter.Format(today);
|
//TODO UNO: var placeholderText = dateTimeFormatter.Format(today);
|
||||||
|
var placeholderText = today.ToString("day month year", CultureInfo.CurrentCulture);
|
||||||
|
|
||||||
DateDiff_FromDate.PlaceholderText = placeholderText;
|
DateDiff_FromDate.PlaceholderText = placeholderText;
|
||||||
DateDiff_ToDate.PlaceholderText = placeholderText;
|
DateDiff_ToDate.PlaceholderText = placeholderText;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<Version>4.3.1</Version>
|
<Version>4.3.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Uno.UI">
|
<PackageReference Include="Uno.UI">
|
||||||
<Version>1.45.0-dev.1533</Version>
|
<Version>1.45.0-dev.1550</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
|
||||||
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1533" />
|
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1550" />
|
||||||
<PackageReference Include="Uno.Wasm.Bootstrap" Version="1.0.0-dev.278" />
|
<PackageReference Include="Uno.Wasm.Bootstrap" Version="1.0.0-dev.278" />
|
||||||
<DotNetCliToolReference Include="Uno.Wasm.Bootstrap.Cli" Version="1.0.0-dev.276" />
|
<DotNetCliToolReference Include="Uno.Wasm.Bootstrap.Cli" Version="1.0.0-dev.276" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -190,7 +190,7 @@
|
||||||
<BundleResource Include="Resources\Fonts\winjs-symbols.ttf" />
|
<BundleResource Include="Resources\Fonts\winjs-symbols.ttf" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1533" />
|
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1550" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Condition=" '$(Platform)' == 'iPhoneSimulator' ">
|
<ItemGroup Condition=" '$(Platform)' == 'iPhoneSimulator' ">
|
||||||
<NativeReference Include="NativeReferences/x86_64/libCalcManager.a">
|
<NativeReference Include="NativeReferences/x86_64/libCalcManager.a">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue