Skip to content

Commit 8fe7965

Browse files
authored
Merge pull request #142 from EasyAbp/abp-9.2
Upgrade to ABP 9.2.1
2 parents 66b1a5e + 9968018 commit 8fe7965

File tree

52 files changed

+2903
-3161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2903
-3161
lines changed

.github/workflows/publish-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
with:
1414
persist-credentials: false
1515
fetch-depth: 0

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ on:
77
- release
88
jobs:
99
publish:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: NuGet/setup-nuget@v1
14-
- uses: actions/setup-dotnet@v3
12+
- uses: actions/checkout@v4
13+
- uses: NuGet/setup-nuget@v2
14+
- uses: actions/setup-dotnet@v4
1515
with:
1616
dotnet-version: '9.0.x'
1717

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<AbpVersion>9.1.1</AbpVersion>
4-
<EasyAbpAbpTagHelperPlusModuleVersion>2.5.0</EasyAbpAbpTagHelperPlusModuleVersion>
3+
<AbpVersion>9.2.1</AbpVersion>
4+
<EasyAbpAbpTagHelperPlusModuleVersion>2.6.0</EasyAbpAbpTagHelperPlusModuleVersion>
55
</PropertyGroup>
66
</Project>

common.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<LangVersion>latest</LangVersion>
4-
<Version>5.6.0</Version>
4+
<Version>5.7.0</Version>
55
<NoWarn>$(NoWarn);CS1591</NoWarn>
66
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
77
<Authors>EasyAbp Team</Authors>
@@ -28,3 +28,4 @@
2828

2929
</Project>
3030

31+

host/EasyAbp.FileManagement.Blazor.Host/EasyAbp.FileManagement.Blazor.Host.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<ItemGroup>
1111
<PackageReference Include="Blazorise.Bootstrap5" Version="1.6.2" />
1212
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.6.2" />
13-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0" />
13+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.4" />
14+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.4" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

host/EasyAbp.FileManagement.Blazor.Server.Host/EasyAbp.FileManagement.Blazor.Server.Host.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
<ItemGroup>
1515
<PackageReference Include="Blazorise.Bootstrap5" Version="1.6.2" />
1616
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.6.2" />
17-
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
18-
<PackageReference Include="Serilog.Sinks.Async" Version="2.0.0" />
19-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0" />
17+
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
18+
<PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" />
19+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.4" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

host/EasyAbp.FileManagement.Blazor.Server.Host/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "my-app",
44
"private": true,
55
"dependencies": {
6-
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~4.1.1",
7-
"@abp/aspnetcore.components.server.leptonxlitetheme": "~4.1.1"
6+
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~4.2.1",
7+
"@abp/aspnetcore.components.server.leptonxlitetheme": "~4.2.1"
88
}
99
}

host/EasyAbp.FileManagement.Blazor.Server.Host/wwwroot/libs/abp/core/abp.js

Lines changed: 67 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,19 @@ var abp = abp || {};
8181
if (resource) {
8282
return resource;
8383
}
84-
84+
8585
var legacySource = abp.localization.values[resourceName];
8686
if (legacySource) {
8787
return {
8888
texts: abp.localization.values[resourceName],
8989
baseResources: []
9090
};
9191
}
92-
93-
abp.log.warn('Could not find localization source: ' + resourceName);
92+
93+
abp.log.warn('Could not find localization source: ' + resourceName);
9494
return null;
9595
};
96-
96+
9797
abp.localization.internal.localize = function (key, sourceName) {
9898
var resource = abp.localization.internal.getResource(sourceName);
9999
if (!resource){
@@ -104,7 +104,7 @@ var abp = abp || {};
104104
}
105105

106106
var value = resource.texts[key];
107-
if (value === undefined) {
107+
if (value === undefined) {
108108
for (var i = 0; i < resource.baseResources.length; i++){
109109
var basedArguments = Array.prototype.slice.call(arguments, 0);
110110
basedArguments[1] = resource.baseResources[i];
@@ -114,7 +114,7 @@ var abp = abp || {};
114114
return result;
115115
}
116116
}
117-
117+
118118
return {
119119
value: key,
120120
found: false
@@ -135,7 +135,7 @@ var abp = abp || {};
135135
if (sourceName === '_') { //A convention to suppress the localization
136136
return key;
137137
}
138-
138+
139139
if (sourceName) {
140140
return abp.localization.internal.localize.apply(this, arguments).value;
141141
}
@@ -750,7 +750,11 @@ var abp = abp || {};
750750

751751
abp.clock.supportsMultipleTimezone = function () {
752752
return abp.clock.kind === 'Utc';
753-
};
753+
}
754+
755+
abp.clock.timeZone = function () {
756+
return abp.setting.get('Abp.Timing.TimeZone') || abp.clock.browserTimeZone();
757+
}
754758

755759
// Normalize Date object or date string to standard string format that will be sent to server
756760
abp.clock.normalizeToString = function (date) {
@@ -763,32 +767,42 @@ var abp = abp || {};
763767
return date;
764768
}
765769

766-
if (abp.clock.kind === 'Utc') {
767-
return dateObj.toISOString();
768-
}
769-
770770
function padZero(num) {
771771
return num < 10 ? '0' + num : num;
772772
}
773773

774-
function padMilliseconds(num) {
775-
if (num < 10) return '00' + num;
776-
if (num < 100) return '0' + num;
777-
return num;
774+
var addZulu = false;
775+
if (abp.clock.supportsMultipleTimezone()) {
776+
var timeZone = abp.clock.timeZone();
777+
var now = new Date();
778+
var formattedDate = now.toLocaleString('en-US', { timeZone: timeZone, timeZoneName: 'longOffset' });
779+
var match = formattedDate.match(/GMT([+-]\d+)/);
780+
var targetOffsetHours = match ? parseInt(match[1], 10) : 0;
781+
dateObj = new Date(dateObj.getTime() - (targetOffsetHours * 60 * 60 * 1000));
782+
addZulu = true;
778783
}
779-
780-
// yyyy-MM-ddTHH:mm:ss.SSS
784+
785+
// yyyy-MM-DDTHH:mm:ss
781786
return dateObj.getFullYear() + '-' +
782-
padZero(dateObj.getMonth() + 1) + '-' +
783-
padZero(dateObj.getDate()) + 'T' +
784-
padZero(dateObj.getHours()) + ':' +
785-
padZero(dateObj.getMinutes()) + ':' +
786-
padZero(dateObj.getSeconds()) + '.' +
787-
padMilliseconds(dateObj.getMilliseconds());
787+
padZero(dateObj.getMonth() + 1) + '-' +
788+
padZero(dateObj.getDate()) + 'T' +
789+
padZero(dateObj.getHours()) + ':' +
790+
padZero(dateObj.getMinutes()) + ':' +
791+
padZero(dateObj.getSeconds()) + (addZulu ? 'Z' : '');
792+
};
793+
794+
// Default options for toLocaleString
795+
abp.clock.toLocaleStringOptions = abp.clock.toLocaleStringOptions || {
796+
"year": "numeric",
797+
"month": "long",
798+
"day": "numeric",
799+
"hour": "numeric",
800+
"minute": "numeric",
801+
"second": "numeric"
788802
};
789803

790804
// Normalize date string to locale date string that will be displayed to user
791-
abp.clock.normalizeToLocaleString = function (dateString) {
805+
abp.clock.normalizeToLocaleString = function (dateString, options) {
792806
if (!dateString) {
793807
return dateString;
794808
}
@@ -797,11 +811,36 @@ var abp = abp || {};
797811
if (isNaN(date)) {
798812
return dateString;
799813
}
800-
801-
//TODO: Get timezone setting and pass it to toLocaleString
802-
return date.toLocaleString();
814+
815+
var culture = abp.localization.currentCulture.cultureName;
816+
options = options || abp.clock.toLocaleStringOptions;
817+
if (abp.clock.supportsMultipleTimezone()) {
818+
var timezone = abp.clock.timeZone();
819+
if (timezone) {
820+
return date.toLocaleString(culture, Object.assign({}, options, { timeZone: timezone }));
821+
}
822+
}
823+
return date.toLocaleString(culture, options);
803824
}
804825

826+
abp.clock.browserTimeZone = function () {
827+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
828+
}
829+
830+
abp.clock.trySetBrowserTimeZoneToCookie = true;
831+
832+
abp.clock.setBrowserTimeZoneToCookie = function () {
833+
if (!abp.clock.trySetBrowserTimeZoneToCookie || !abp.clock.supportsMultipleTimezone()) {
834+
return;
835+
}
836+
837+
abp.utils.setCookieValue('__timezone', abp.clock.browserTimeZone(), new Date(new Date().setFullYear(new Date().getFullYear() + 1)), '/');
838+
}
839+
840+
abp.event.on('abp.configurationInitialized', function () {
841+
abp.clock.setBrowserTimeZoneToCookie();
842+
});
843+
805844
/* FEATURES *************************************************/
806845

807846
abp.features = abp.features || {};

host/EasyAbp.FileManagement.Blazor.Server.Host/wwwroot/libs/abp/luxon/abp.luxon.js

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var abp = abp || {};
3232
.fromFormat(
3333
getObjectValue(form, field),
3434
abp.localization.currentCulture.dateTimeFormat.shortDatePattern,
35-
{locale: abp.localization.currentCulture.cultureName}
35+
{ locale: abp.localization.currentCulture.cultureName }
3636
);
3737

3838
if (!dateTime.invalid) {
@@ -43,4 +43,60 @@ var abp = abp || {};
4343
return form;
4444
}
4545

46+
// Normalize Date object or date string to standard string format that will be sent to server
47+
abp.clock.normalizeToString = function (date) {
48+
if (!date) {
49+
return date;
50+
}
51+
52+
var dateObj = date instanceof Date ? date : new Date(date);
53+
if (isNaN(dateObj)) {
54+
return date;
55+
}
56+
57+
var timeZone = abp.clock.timeZone();
58+
if (abp.clock.supportsMultipleTimezone() && timeZone) {
59+
return luxon.DateTime.fromObject({
60+
year: dateObj.getFullYear(),
61+
month: dateObj.getMonth() + 1,
62+
day: dateObj.getDate(),
63+
hour: dateObj.getHours(),
64+
minute: dateObj.getMinutes(),
65+
second: dateObj.getSeconds()
66+
}, { zone: timeZone }).setZone("utc").toISO();
67+
} else {
68+
return luxon.DateTime.fromJSDate(dateObj).toFormat("yyyy-MM-dd'T'HH:mm:ss");
69+
}
70+
};
71+
72+
// Normalize date string to locale date string that will be displayed to user
73+
abp.clock.normalizeToLocaleString = function (dateString, options) {
74+
if (!dateString) {
75+
return dateString;
76+
}
77+
78+
var date = new Date(dateString);
79+
if (isNaN(date)) {
80+
return dateString;
81+
}
82+
83+
options = options || abp.clock.toLocaleStringOptions;
84+
if (abp.clock.supportsMultipleTimezone()) {
85+
var timezone = abp.clock.timeZone();
86+
if (timezone) {
87+
return luxon.DateTime.fromJSDate(date)
88+
.setZone(timezone)
89+
.setLocale(abp.localization.currentCulture.cultureName)
90+
.toLocaleString(options);
91+
}
92+
}
93+
94+
return luxon.DateTime.fromJSDate(date)
95+
.setLocale(abp.localization.currentCulture.cultureName)
96+
.toLocaleString(options);
97+
}
98+
99+
abp.clock.browserTimeZone = function () {
100+
return luxon.DateTime.local().zoneName;
101+
}
46102
})(jQuery);

0 commit comments

Comments
 (0)