Replace timeago with timeago.js - #26001
Merged
Merged
Conversation
EngincanV
approved these changes
Aug 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates ABP’s MVC UI timeago integration by replacing the legacy timeago (jQuery-dependent) library with timeago.js, and adds an ABP wrapper to preserve the existing $.timeago() / $.fn.timeago() API for compatibility.
Changes:
- Switch
@abp/timeagodependency fromtimeagototimeago.jsand update resource mappings accordingly. - Add
abp.timeago.jswrapper that maps ABP culture totimeago.jslocales, providesabp.timeago.*APIs, and keeps jQuery plugin compatibility when jQuery is present. - Update MVC bundling/contributors, DOM initializers, and docs to reference the new library.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| npm/packs/timeago/src/abp.timeago.js | Adds ABP wrapper around timeago.js, including locale mapping and optional jQuery compatibility shims. |
| npm/packs/timeago/package.json | Replaces timeago dependency with timeago.js. |
| npm/packs/timeago/abp.resourcemapping.js | Updates mapping to ship timeago.js dist files and the new ABP wrapper. |
| framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js | Updates timeago DOM initialization and adds cleanup on node removal. |
| framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Timeago/TimeagoScriptContributor.cs | Updates bundle contributor to include timeago.js + abp.timeago.js instead of jquery.timeago. |
| framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/AbpAspNetCoreMvcUiPackagesModule.cs | Removes localization mapping previously used for jquery.timeago locale files. |
| docs/en/framework/ui/mvc-razor-pages/theming.md | Updates documentation reference from Timeago to timeago.js. |
| docs/en/framework/ui/mvc-razor-pages/overall.md | Updates documentation reference from Timeago to timeago.js. |
| docs/en/framework/ui/mvc-razor-pages/bundling-minification.md | Updates example output script reference to timeago.js dist file. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| args.$el.findWithSelf('[data-bs-toggle="tooltip"]').each(function () { | ||
| $('#' + $(this).attr('aria-describedby')).remove(); | ||
| }); | ||
| abp.timeago.cancel(args.$el.findWithSelf('[timeago-id]').toArray()); |
Comment on lines
+4
to
+6
| if (typeof timeago === 'undefined') { | ||
| throw "abp/timeago library requires the timeago.js library included to the page!"; | ||
| } |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolve #25965
@abp/timeagonow shipstimeago.js(no jQuery dependency) plusabp.timeago.js, which maps the current culture to atimeago.jslocale and keeps$.fn.timeago()/$.timeago()working for existing callers.