Skip to content

Replace timeago with timeago.js - #26001

Merged
maliming merged 3 commits into
devfrom
maliming/replace-timeago
Aug 21, 2026
Merged

Replace timeago with timeago.js#26001
maliming merged 3 commits into
devfrom
maliming/replace-timeago

Conversation

@maliming

Copy link
Copy Markdown
Member

Resolve #25965

@abp/timeago now ships timeago.js (no jQuery dependency) plus abp.timeago.js, which maps the current culture to a timeago.js locale and keeps $.fn.timeago() / $.timeago() working for existing callers.

@maliming maliming added this to the 10.8-preview milestone Aug 18, 2026
@maliming
maliming requested a review from EngincanV August 21, 2026 01:52
@maliming
maliming marked this pull request as ready for review August 21, 2026 07:38
Copilot AI lite review requested due to automatic review settings August 21, 2026 07:38
@maliming
maliming merged commit d88e104 into dev Aug 21, 2026
3 of 4 checks passed
@maliming
maliming deleted the maliming/replace-timeago branch August 21, 2026 07:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/timeago dependency from timeago to timeago.js and update resource mappings accordingly.
  • Add abp.timeago.js wrapper that maps ABP culture to timeago.js locales, provides abp.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!";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace timeago with timeago.js

3 participants