Skip to content

Commit 25a0f31

Browse files
committed
Merge branch 'issue-8028-quote-details-page-timezone-inconsistency' into develop
2 parents 4bc4031 + bbab061 commit 25a0f31

File tree

5 files changed

+39
-25
lines changed

5 files changed

+39
-25
lines changed

src/Plugins/Nop.Plugin.Misc.RFQ/Data/Migrations/AddLocales.cs

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,20 @@
1-
using System.Globalization;
2-
using FluentMigrator;
1+
using FluentMigrator;
32
using Nop.Data;
43
using Nop.Data.Migrations;
5-
using Nop.Services.Common;
6-
using Nop.Services.Localization;
4+
using Nop.Web.Framework.Extensions;
75

86
namespace Nop.Plugin.Misc.RFQ.Data.Migrations;
97

108
[NopMigration("2025/11/01 19:41:53:1677556", "Misc.RFQ add the locale")]
119
public class AddLocales : Migration
1210
{
13-
private readonly ILanguageService _languageService;
14-
private readonly ILocalizationService _localizationService;
15-
16-
public AddLocales(ILanguageService languageService,
17-
ILocalizationService localizationService)
18-
{
19-
_languageService = languageService;
20-
_localizationService = localizationService;
21-
}
22-
2311
/// <summary>Collect the UP migration expressions</summary>
2412
public override void Up()
2513
{
2614
if (!DataSettingsManager.IsDatabaseInstalled())
2715
return;
2816

29-
var languages = _languageService.GetAllLanguagesAsync(true).Result;
30-
var languageId = languages
31-
.Where(lang => lang.UniqueSeoCode == new CultureInfo(NopCommonDefaults.DefaultLanguageCulture).TwoLetterISOLanguageName)
32-
.Select(lang => lang.Id).FirstOrDefault();
33-
34-
_localizationService.AddOrUpdateLocaleResourceAsync(new Dictionary<string, string>
17+
this.AddOrUpdateLocaleResource(new Dictionary<string, string>
3518
{
3619
["Plugins.Misc.RFQ.ShowCaptchaOnRequestPage"] = "Show CAPTCHA on request page",
3720
["Plugins.Misc.RFQ.ShowCaptchaOnRequestPage.Hint"] = "Check to show CAPTCHA on request page, when send the new request a quote.",
@@ -43,7 +26,7 @@ public override void Up()
4326
["Plugins.Misc.RFQ.AllowCustomerGenerateQuotePdf"] = "Quote PDF is allowed for the customer",
4427
["Plugins.Misc.RFQ.AllowCustomerGenerateQuotePdf.Hint"] = "Check to allow the generation of the quote PDF for the customer",
4528
["Plugins.Misc.RFQ.Fields.Quote.CustomerInfo"] = "Customer"
46-
}, languageId).Wait();
29+
});
4730
}
4831

4932
/// <summary>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using FluentMigrator;
2+
using Nop.Data;
3+
using Nop.Data.Migrations;
4+
using Nop.Web.Framework.Extensions;
5+
6+
namespace Nop.Plugin.Misc.RFQ.Data.Migrations;
7+
8+
[NopMigration("2026/01/13 18:41:53:1677556", "Misc.RFQ add the locale")]
9+
public class UpdateDateTimeLocales : Migration
10+
{
11+
/// <summary>Collect the UP migration expressions</summary>
12+
public override void Up()
13+
{
14+
if (!DataSettingsManager.IsDatabaseInstalled())
15+
return;
16+
17+
this.AddOrUpdateLocaleResource(new Dictionary<string, string>
18+
{
19+
["Plugins.Misc.RFQ.Fields.Quote.CreatedOn.Hint"] = "The date/time (in the current customer time zone) that the quote was created.",
20+
["Plugins.Misc.RFQ.Fields.RequestQuote.CreatedOn.Hint"] = "The date/time (in the current customer time zone) that the request a quote was created.",
21+
});
22+
}
23+
24+
/// <summary>
25+
/// Collects the DOWN migration expressions
26+
/// </summary>
27+
public override void Down()
28+
{
29+
//nothing
30+
}
31+
}

src/Plugins/Nop.Plugin.Misc.RFQ/RfqPlugin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ await _localizationService.AddOrUpdateLocaleResourceAsync(new Dictionary<string,
169169
["Plugins.Misc.RFQ.CustomerRequest.Info"] = "Request info",
170170
["Plugins.Misc.RFQ.CustomerQuote.Info"] = "Quote info",
171171
["Plugins.Misc.RFQ.Fields.Quote.CreatedOn"] = "Created on",
172-
["Plugins.Misc.RFQ.Fields.Quote.CreatedOn.Hint"] = "The date/time that the quote was created.",
172+
["Plugins.Misc.RFQ.Fields.Quote.CreatedOn.Hint"] = "The date/time (in the current customer time zone) that the quote was created.",
173173
["Plugins.Misc.RFQ.Fields.RequestQuote.CreatedOn"] = "Created on",
174-
["Plugins.Misc.RFQ.Fields.RequestQuote.CreatedOn.Hint"] = "The date/time that the request a quote was created.",
174+
["Plugins.Misc.RFQ.Fields.RequestQuote.CreatedOn.Hint"] = "The date/time (in the current customer time zone) that the request a quote was created.",
175175
["Plugins.Misc.RFQ.Fields.Quote.Status"] = "Status",
176176
["Plugins.Misc.RFQ.Fields.Quote.Status.Hint"] = "The status of the quote",
177177
["Plugins.Misc.RFQ.Fields.RequestQuote.Status"] = "Status",

src/Plugins/Nop.Plugin.Misc.RFQ/Services/RfqService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private void LogNote(IAdminNote noteItem, string note)
172172
if (string.IsNullOrEmpty(note))
173173
return;
174174

175-
note = DateTime.UtcNow.ToString(RfqDefaults.DateTimeStringFormat) + $": {note}";
175+
note = DateTime.UtcNow.ToString(RfqDefaults.DateTimeStringFormat) + $"(UTC): {note}";
176176

177177
if (!string.IsNullOrEmpty(noteItem.AdminNotes))
178178
note += "\r\n";

src/Plugins/Nop.Plugin.Misc.RFQ/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Group": "Misc",
33
"FriendlyName": "\"Request for quote\" and \"Quotes\"",
44
"SystemName": "Misc.RFQ",
5-
"Version": "5.00.7",
5+
"Version": "5.00.8",
66
"SupportedVersions": ["5.00"],
77
"Author": "nopCommerce team",
88
"DisplayOrder": 1,

0 commit comments

Comments
 (0)