• Stars
    star
    236
  • Rank 164,977 (Top 4 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DNTPersianUtils.Core is a collection of Persian helper extension methods

DNTPersianUtils.Core

GitHub Actions status

DNTPersianUtils.Core کتابخانه‌ای است متشکل از متدهای الحاقی کمکی جهت کار با فرهنگ فارسی، در برنامه‌های مبتنی بر NET Core. و همچنین NET 4.x. برای نصب آن دستور ذیل را در کنسول پاورشل نیوگت اجرا کنید:

Nuget

PM> Install-Package DNTPersianUtils.Core

لیست متدها و امکانات این کتابخانه

نام متد/امکانات مثال خروجی نمونه
نمایش فارسی روز دریافتی dt.ToPersianDateTextify() سه شنبه ۲۱ دی ۱۳۹۵
نمایش دوستانه‌ی یک تاریخ و ساعت انگلیسی به شمسی dt.ToFriendlyPersianDateTextify() ‫۱۰ روز قبل، سه شنبه ۲۱ دی ۱۳۹۵، ساعت ۱۰:۲۰
تبدیلگر عدد به حروف 1234567.NumberToText(Language.Persian) یک میلیون و دویست و سی و چهار هزار و پانصد و شصت و هفت
نگارش اصلاح شده‌ی فرهنگ فارسی PersianCulture.Instance
Thread.CurrentThread.CurrentCulture = PersianCulture.Instance;
در این فرهنگ تاریخ میلادی با شمسی جایگزین شده‌است
تبدیل تاریخ و زمان رشته‌ای شمسی به میلادی "1395/11/3 7:30".ToGregorianDateTime() new DateTime(2017, 1, 22, 7, 30, 0)
تبدیل تاریخ میلادی به شمسی dt.ToLongPersianDateString() ‫21 دی 1395
تبدیل تاریخ میلادی به شمسی dt.ToLongPersianDateTimeString() ‫21 دی 1395، 10:20:02 ق.ظ
تبدیل تاریخ میلادی به شمسی dt.ToPersianDateTimeString("dd MMMM yyyy") این تبدیل بر اساس فرهنگ اصلاح شده‌ی فارسی صورت می‌گیرد. مانند
dt.ToPersianDateTimeString("dd MMMM yyyy - HH:mm")
‫ با این خروجی فرضی: «21 دی 1395 - 10:20»
تبدیل تاریخ میلادی به شمسی dt.ToShortPersianDateString() 1395/10/21
تبدیل تاریخ میلادی به شمسی dt.ToShortPersianDateTimeString() 1395/10/21 10:20
تاریخ روزهای ابتدا و انتهای سال شمسی dt.GetPersianYearStartAndEndDates() مثال
تاریخ روزهای ابتدا و انتهای ماه شمسی dt.GetPersianMonthStartAndEndDates() مثال
تاریخ روزهای ابتدا و انتهای هفته شمسی dt.GetPersianWeekStartAndEndDates() مثال
تبدیل عدد انگلیسی به فارسی 123.ToPersianNumbers() ۱۲۳
آیا عبارت مدنظر حاوی حروف فارسی است؟ "Abc تست".ContainsFarsi() true
اصلاح ي و ك عربی به فارسی "سنجاقك آبي".ApplyCorrectYeKe() سنجاقک آبی
راست به چپ کردن یک متن ساده مخلوط برای نمایش در محیط‌های چپ به راست مانند فید خوان‌ها "سلام Abc".ApplyRle() Abc سلام
محاسبه سن DateTime.Now.AddYears(-9).GetAge() 9
آیا تاریخ و زمان مدنظر آغاز سال نوی شمسی است؟ dt.IsStartOfNewYear() true/false
مجموعه کلمات بی‌اثر زبان فارسی PersianStopwords.List مفید برای تنظیمات جستجوهای تمام متنی
‫ نرمال کردن متون. پارامتر آن قابلیت ترکیب را دارد. "'تست'".NormalizePersianText(
PersianNormalizers.ConvertEnglishQuotes)
«تست»
لیست مناطق و استان‌ها Iran.Provinces Iran.Provinces لیست تو در توی استان‌ها و شهرهای ایران
مناسبت‌های تعطیلات رسمی ایران Iran.Holidays مناسبت‌های تعطیلات رسمی ایران از سال 1395 تا پایان سال 1402
دریافت لیست روزهای کاری یک بازه زمانی IranHolidays.GetBusinessDays() روزهای کاری ایران از سال 1395 تا پایان سال 1402
تبدیل تاریخ میلادی به قمری new DateTime(2018, 08, 31).ToIslamicDay() new IslamicDay(1439, 12, 19)
تبدیل تاریخ شمسی به قمری IslamicDateUtils.PersianDayToIslamicDay(1397, 6, 9) new IslamicDay(1439, 12, 19)

اعتبارسنج‌ها

نام متد/امکانات مثال خروجی نمونه
تعیین اعتبار تاریخ و زمان رشته‌ای شمسی "1395/12/30".IsValidPersianDateTime()
‫به همراه [ValidPersianDateTime] مخصوص MVC
true
بررسی اعتبار کد ملی "0010350829".IsValidIranianNationalCode()
‫به همراه [ValidIranianNationalCode] مخصوص MVC
true
بررسی اعتبار کد بانکی شبا "IR820540102680020817909002".
IsValidIranShebaNumber()
‫به همراه [ValidIranShebaNumber] مخصوص MVC
true
بررسی اعتبار کد بانکی شتاب "6221061106498670".
IsValidIranShetabNumber()
‫به همراه [ValidIranShetabNumber] مخصوص MVC
true
بررسی اعتبار شماره موبایل "09901464762".
IsValidIranianMobileNumber()
‫به همراه [ValidIranianMobileNumber] مخصوص MVC
true
بررسی اعتبار شماره تلفن "37236445".
IsValidIranianPhoneNumber()
‫به همراه [ValidIranianPhoneNumber] مخصوص MVC
true
بررسی اعتبار کد پستی "1619735744".
IsValidIranianPostalCode()
‫به همراه [ValidIranianPostalCode] مخصوص MVC
true
بررسی اعتبار اعداد تمام فارسی "۹۹۹۹۹".
ContainsOnlyPersianNumbers()
‫به همراه [ShouldContainOnlyPersianNumbers] مخصوص MVC
true
بررسی اعتبار حروف و یا اعداد فارسی بودن تنها قسمتی از متن "Abc تست".
ContainsFarsi()
‫به همراه [ShouldContainPersianLettersOrNumbers] مخصوص MVC
true
بررسی اعتبار حروف فارسی بودن تمام متن "تست".
ContainsOnlyFarsiLetters()
‫به همراه [ShouldContainOnlyPersianLetters] مخصوص MVC
true
بررسی اعتبار شناسه ملی حقوقی "14005893875".IsValidIranianNationalLegalCode()
‫به همراه [ValidIranianNationalLegalCodeAttribute] مخصوص MVC
true

نحوه کار با اطلاعات استان‌ها

foreach (var province in Iran.Provinces)
{
     foreach (var county in province.Counties)
     {
          foreach (var district in county.Districts)
          {
                foreach (var city in district.Cities)
                {
                }
          }
     }
}

مشاهده مستندات كامل اين كتابخانه

More Repositories

1

EFCoreSecondLevelCacheInterceptor

EF Core Second Level Cache Interceptor
C#
635
star
2

iTextSharp.LGPLv2.Core

iTextSharp.LGPLv2.Core is an unofficial port of the last LGPL version of the iTextSharp (V4.1.6) to .NET Core
C#
551
star
3

EPPlus.Core

EPPlus.Core is an unofficial port of the EPPlus library to .NET Core
C#
369
star
4

PdfReport.Core

PdfReport.Core is a code first reporting engine, which is built on top of the iTextSharp.LGPLv2.Core and EPPlus.Core libraries
C#
350
star
5

EFSecondLevelCache.Core

Entity Framework Core Second Level Caching Library
C#
329
star
6

ASPNETCore2JwtAuthentication

Jwt Authentication without ASP.NET Core Identity
SCSS
298
star
7

OpenCVSharp-Samples

A collection of samples about using OpenCV in .NET applications.
C#
257
star
8

DNTIdentity

A highly customized sample of the ASP.NET Core Identity
C#
232
star
9

DNTCaptcha.Core

DNTCaptcha.Core is a captcha generator and validator for ASP.NET Core applications
SCSS
205
star
10

GitHubFolderDownloader

It lets you to download a single folder of a repository without cloning or downloading the whole repository.
C#
164
star
11

Process-Proxifier

Using FiddlerCore to add proxy settings to the Windows applications
C#
151
star
12

DNTCommon.Web.Core

DNTCommon.Web.Core provides common scenarios' solutions for ASP.NET Core applications.
C#
130
star
13

PdfReport

PdfReport is a code first reporting engine, which is built on top of the iTextSharp and EPPlus libraries.
C#
91
star
14

EnglishToPersianDictionaries

A collection of English to Persian dictionaries
Java
87
star
15

EFSecondLevelCache

Entity Framework 6.x Second Level Caching Library.
C#
65
star
16

DNTProfiler

DNTProfiler is an EF 6.x and NH 4.x profiler.
C#
59
star
17

PersianBingCalendar

Bing daily wallpaper images with Persian calendar
C#
58
star
18

DNTScanner.Core

DNTScanner.Core is a .NET 4x and .NET Core 2x+ wrapper for the Windows Image Acquisition library.
C#
57
star
19

IdentityServerImageGallery

How to use IdentityServer 4.x with an ASP.NET Core app
C#
55
star
20

JwtWithWebAPI

Creating a RESTful API with authentication using Web API 2.x and JSON Web Tokens
JavaScript
44
star
21

DNTScheduler.Core

DNTScheduler.Core is a lightweight ASP.NET Core's background tasks runner and scheduler
C#
44
star
22

DNTPersianComponents.Blazor

A collection of Persian components for Blazor
SCSS
39
star
23

DNTBreadCrumb.Core

DNTBreadCrumb.Core Creates custom bread crumb definitions, based on Twitter Bootstrap features for ASP.NET Core applications.
SCSS
32
star
24

AspNetIdentityDependencyInjectionSample

ASP.NET Identity Dependency Injection Sample
JavaScript
31
star
25

ASPNETCore2CookieAuthentication

Cookie Authentication without ASP.NET Core Identity 7x
SCSS
31
star
26

angular-template-driven-forms-lab

A collection of tips and tricks about how to use an Angular (2+) app with an ASP.NET Core app.
TypeScript
30
star
27

DNTCaptcha.Blazor

A captcha generator for the Blazor based applications.
SCSS
30
star
28

AutoMapperSamples

Using AutoMapper with Entity Framework.
C#
26
star
29

QueryingInEFCore

Querying in Entity Framework Core
C#
25
star
30

IranianITBloggers

A collection of RSS feeds of Iranian IT bloggers
25
star
31

DNTScheduler

DNTScheduler is a super simple ASP.NET's background tasks runner and scheduler.
C#
24
star
32

MvcPlugin

How to create plugins for ASP.NET MVC 4.x/5.x applications.
C#
22
star
33

SubtitleTools

SubtitleTools is a small utility that helps modifying existing subtitles or downloading new ones
C#
21
star
34

AngularMaterialLab

A collection of tips and tricks about how to use an Angular Material 9x app with an ASP.NET Core app
TypeScript
21
star
35

HotelManagementSample

This is a sample project to demonstrate how to work with EF-Core, Web-API, ASP.NET Core identity, Blazor Wasm and Blazor Server
C#
20
star
36

BlazorWasmDynamicPermissions

Blazor WASM Dynamic Permissions
SCSS
19
star
37

KendoUI-Samples

Using KendoUI with ASP.NET.
JavaScript
16
star
38

Exports

Expotred files of the .NET Tips.
C#
15
star
39

WpfFramework

Using Entity framework code-first and unit of work pattern with WPF applications.
C#
14
star
40

DntConsole

This a .NET 7x console app template
C#
14
star
41

KendoUI.Core.Samples

Using KendoUI with ASP.NET Core
JavaScript
14
star
42

SignalR-Samples

Using SiganlR in ASP.NET applications.
JavaScript
13
star
43

Froala-Sample

Using Froala WYSIWYG Editor with ASP.NET
JavaScript
12
star
44

Dependency-Injection-Samples

.NET Dependency Injection Samples
C#
12
star
45

ElmahEFLogger

Global exceptions logger for Entity Framework 6.x using ELMAH
C#
12
star
46

Solution-Template-Generator

Solution template generator, gets a .SLN file containing multiple projects and then converts it to a .VSIX file
C#
12
star
47

jqGrid-Samples

Using jqGrid with ASP.NET MVC
JavaScript
11
star
48

DNTBreadCrumb

DNTBreadCrumb Creates custom bread crumb definitions, based on Twitter Bootstrap 3.x features
C#
11
star
49

MVC5Angular2

Using AngularJS 2.0 with ASP.NET MVC 5.x
TypeScript
11
star
50

ApiUrlsGenerator

This library will help you to convert your `stringly typed` API URL's to strongly typed ones
C#
8
star
51

Mvc-App-Persian-DatePicker

Using JavaScript PersianDatePicker in ASP.NET applications.
CSS
7
star
52

UoW-Sample

Using multiple databases with EF Code First, UoW & DI patterns.
C#
7
star
53

EFCoreSQLiteFTS

Implementing full-text search with SQLite and EF-Core
C#
7
star
54

AOP-Sample

AOP Samples, mostly using StructureMap & Castle.Core
C#
4
star
55

Silverlight-Persian-DatePicker

Silverlight 4 & 5 Persian DatePicker
C#
3
star
56

MVC-Samples

ASP.NET MVC Step By Step
C#
3
star
57

MVC-Ajax-Form-Upload

Adding file upload support to Ajax.BeginForm
JavaScript
3
star
58

ExplorerPCal

Replacing the default Windows calendar with .NET hooks
C#
3
star
59

ProxyValidator

An automated service for validating free to use proxy servers
C#
2
star
60

RemovePdfLinks

Pdf Links Remover.
C#
1
star
61

Disposable-Email-Address-Detector

Using nameapi.org's API in .NET
C#
1
star
62

OpenAPISwaggerDoc

This is a sample project to show how to use the OpenAPI Swagger in .NET apps
C#
1
star
63

.NET-Persian-Subtitles

Persian subtitles for the various .NET related courses
HTML
1
star
64

OxyPlotWpfTests

An OxyPlot Sample
C#
1
star