Skip to content

Commit 405a1ff

Browse files
committed
Merge pull request #150 from MabOneSdk/dev1
fixing datetime tostring locale issue
2 parents 56de02e + 8d5b896 commit 405a1ff

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/RegisterAzureRMBackupContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private bool IsDiscoveryNeeded(string vmName, string rgName, out CSMContainerRes
176176
else
177177
{
178178
//We can have multiple container with same friendly name.
179-
container = containers.Where(c => ContainerHelpers.GetRGNameFromId(c.Properties.ParentContainerId).Equals(rgName.ToLower())).FirstOrDefault(); //TODO need to change.
179+
container = containers.Where(c => ContainerHelpers.GetRGNameFromId(c.Properties.ParentContainerId).Equals(rgName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
180180
if (container == null)
181181
{
182182
//Container is not in list of registered container

src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Jobs/GetAzureRMBackupJob.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16+
using System.Globalization;
1617
using System.Management.Automation;
1718
using System.Collections.Generic;
1819
using System.Xml;
@@ -132,17 +133,19 @@ protected override void ProcessRecord()
132133
To = DateTime.UtcNow;
133134
}
134135

135-
WriteDebug(String.Format(Resources.StartTimeFilter, System.Uri.EscapeDataString(From.Value.ToString("yyyy-MM-dd hh:mm:ss tt"))));
136-
WriteDebug(String.Format(Resources.EndTimeFilter, System.Uri.EscapeDataString(To.Value.ToString("yyyy-MM-dd hh:mm:ss tt"))));
136+
DateTimeFormatInfo format = new CultureInfo("en-US").DateTimeFormat;
137+
WriteDebug(String.Format(Resources.StartTimeFilter, System.Uri.EscapeDataString(From.Value.ToString("yyyy-MM-dd hh:mm:ss tt", format))));
138+
WriteDebug(String.Format(Resources.EndTimeFilter, System.Uri.EscapeDataString(To.Value.ToString("yyyy-MM-dd hh:mm:ss tt", format))));
137139
WriteDebug(String.Format(Resources.OperationFilter, Operation));
138140
WriteDebug(String.Format(Resources.StatusFilter, Status));
139141
WriteDebug(String.Format(Resources.TypeFilter, Type));
140142
WriteDebug(String.Format(Resources.JobIdFilter, JobId));
141143

142144
Mgmt.CSMJobQueryObject queryParams = new Mgmt.CSMJobQueryObject()
143145
{
144-
StartTime = From.Value.ToString("yyyy-MM-dd hh:mm:ss tt"),
145-
EndTime = To.Value.ToString("yyyy-MM-dd hh:mm:ss tt"),
146+
147+
StartTime = From.Value.ToString("yyyy-MM-dd hh:mm:ss tt", format),
148+
EndTime = To.Value.ToString("yyyy-MM-dd hh:mm:ss tt", format),
146149
Operation = Operation,
147150
Status = Status,
148151
WorkloadType = Type,

0 commit comments

Comments
 (0)