forked from abpframework/abp-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request abpframework#40 from abpframework/maliming/upgrade…
…_3.2 Upgrade samples to 3.2.1.
- Loading branch information
Showing
566 changed files
with
10,144 additions
and
48,760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
Authentication-Customization/src/Acme.BookStore.Web/wwwroot/libs/abp/luxon/abp.luxon.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
var abp = abp || {}; | ||
(function () { | ||
|
||
if (!luxon) { | ||
throw "abp/luxon library requires the luxon library included to the page!"; | ||
} | ||
|
||
/* TIMING *************************************************/ | ||
|
||
abp.timing = abp.timing || {}; | ||
|
||
var setObjectValue = function (obj, property, value) { | ||
if (typeof property === "string") { | ||
property = property.split('.'); | ||
} | ||
|
||
if (property.length > 1) { | ||
var p = property.shift(); | ||
setObjectValue(obj[p], property, value); | ||
} else { | ||
obj[property[0]] = value; | ||
} | ||
} | ||
|
||
var getObjectValue = function (obj, property) { | ||
return property.split('.').reduce((a, v) => a[v], obj) | ||
} | ||
|
||
abp.timing.convertFieldsToIsoDate = function (form, fields) { | ||
for (var field of fields) { | ||
var dateTime = luxon.DateTime | ||
.fromFormat( | ||
getObjectValue(form, field), | ||
abp.localization.currentCulture.dateTimeFormat.shortDatePattern, | ||
{locale: abp.localization.currentCulture.cultureName} | ||
); | ||
|
||
if (!dateTime.invalid) { | ||
setObjectValue(form, field, dateTime.toFormat("yyyy-MM-dd HH:mm:ss")) | ||
} | ||
} | ||
|
||
return form; | ||
} | ||
|
||
})(jQuery); |
Oops, something went wrong.