Localize timeago and auto handle .timeago class.

pull/3734/head
Halil İbrahim Kalkan 5 years ago
parent 0ee3e328a5
commit 3cc25365a2

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Globalization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQuery;
using Volo.Abp.Modularity;
@ -12,5 +13,16 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Timeago
{
context.Files.AddIfNotContains("/libs/timeago/jquery.timeago.js");
}
public override void ConfigureDynamicResources(BundleConfigurationContext context)
{
var cultureName = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
var cultureFileName = $"/libs/timeago/locales/jquery.timeago.{cultureName}.js";
if (context.FileProvider.GetFileInfo(cultureFileName).Exists)
{
context.Files.Add(cultureFileName);
}
}
}
}

@ -60,6 +60,8 @@
container: 'body'
});
args.$el.findWithSelf('.timeago').timeago();
enableFormFeatures(args.$el.findWithSelf('form'), true);
initializeScript(args.$el);
@ -82,6 +84,8 @@
container: 'body'
});
$('.timeago').timeago();
$('[data-auto-focus="true"]').first().findWithSelf('input,select').focus();
});

Loading…
Cancel
Save