mirror of https://github.com/abpframework/abp.git
7 changed files with 80 additions and 3 deletions
@ -0,0 +1,43 @@ |
|||
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; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Timeago |
|||
{ |
|||
[DependsOn(typeof(JQueryScriptContributor))] |
|||
public class BootstrapDatepickerScriptContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/libs/bootstrap-datepicker/bootstrap-datepicker.min.js"); |
|||
} |
|||
|
|||
public override void ConfigureDynamicResources(BundleConfigurationContext context) |
|||
{ |
|||
var cultureName = CultureInfo.CurrentUICulture.DateTimeFormat.Calendar.AlgorithmType == |
|||
CalendarAlgorithmType.LunarCalendar |
|||
? "en" |
|||
: CultureInfo.CurrentUICulture.Name; |
|||
|
|||
if (TryAddCultureFile(context, cultureName)) |
|||
{ |
|||
return; |
|||
} |
|||
} |
|||
|
|||
protected virtual bool TryAddCultureFile(BundleConfigurationContext context, string cultureName) |
|||
{ |
|||
var filePath = $"/libs/bootstrap-datepicker/locales/bootstrap-datepicker.{cultureName}.js"; |
|||
|
|||
if (!context.FileProvider.GetFileInfo(filePath).Exists) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
context.Files.AddIfNotContains(filePath); |
|||
return true; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Select2 |
|||
{ |
|||
public class BootstrapDatepickerStyleContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/libs/bootstrap-datepicker/bootstrap-datepicker.min.css"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
module.exports = { |
|||
mappings: { |
|||
"@node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js": "@libs/bootstrap-datepicker/", |
|||
"@node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css": "@libs/bootstrap-datepicker/", |
|||
"@node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.css.map": "@libs/bootstrap-datepicker/", |
|||
"@node_modules/bootstrap-datepicker/dist/locales/*.*": "@libs/bootstrap-datepicker/locales/" |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
{ |
|||
"version": "0.9.0", |
|||
"name": "@abp/bootstrap-datepicker", |
|||
"publishConfig": { |
|||
"access": "public" |
|||
}, |
|||
"dependencies": { |
|||
"bootstrap-datepicker": "^1.9.0" |
|||
} |
|||
} |
|||
Loading…
Reference in new issue