パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v3.0.1

hijri

ヒジュラ暦とグレゴリオ暦の日付を相互に変換し、アラビア語および英語のローカライズをサポートします。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
3.6万
いいね数
145
Pub ポイント
140

パッケージをインストール

flutter pub add hijri

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

hijri パッケージは、Flutter アプリケーションでヒジュラ暦(イスラム暦)とグレゴリオ暦の日付をシームレスに変換する機能を提供します。アラビア語および英語のロケールに対応しており、ムスリムコミュニティ向けや宗教的な日付計算が必要なアプリに最適です。このパッケージは軽量で、Android、iOS、Web、macOS、Windows、Linuxなどすべての主要プラットフォームで動作し、簡単に統合できます。正確な日付のフォーマットと解析を処理し、ラマダンやイドなどのイスラム暦イベントに対して信頼できる結果を保証します。

用途

  • イスラム行事のスケジューリング
  • マルチリンガルカレンダーディスプレイ
  • 宗教アプリ開発
  • ファイナンスアプリにおける日付変換
  • クロスカレンダー互換性

主な機能

  • ヒジュラ暦-グレゴリオ暦日付変換
  • アラビア語および英語のロケール対応
  • プラットフォームに依存しない実装
  • 正確なイスラム暦の計算
  • シンプルな API インテグレーション

適している対象

  • ムスリムユーザー向けのアプリ
  • 宗教的または文化的アプリケーション
  • 国際日付処理
  • 二重カレンダーが必要なモバイルおよびウェブアプリ
  • 複数言語をサポートする開発者

注意事項

  • ヒジュラ暦のルールを理解する必要がある
  • 日単位の精度に制限
  • タイムゾーンの処理なし
  • 正確な入力日付に依存します
  • UI表示用に追加のフォーマットが必要になる可能性があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Hijri

Hijri Calendar Converter

Usage
//Suppose current gregorian data/time is: Mon May 29 00:27:33  2018
  var _today = HijriCalendar.now();
  print(_today.hYear); // 1439
  print(_today.hMonth); // 9
  print(_today.hDay); // 14
  print(_today.getDayName()); // 14
  // Get month length in days
  print(_today.lengthOfMonth); // 30 days
  print(_today.toFormat("MMMM dd yyyy")); //Ramadan 14 1439
Change Local
  HijriCalendar.setLocal(locale);
Add New Locale
  HijriCalendar.addLocale(locale, {
    'long': ...,
    'short': ...,
    'days': ...,
    'short_days': ...
  });
  HijriCalendar.setLocal(locale);
From Gregorian to Ummalqura
var h_date = HijriCalendar.fromDate(DateTime(2018, 11, 12));
print(h_date.toString()); //04/03/1440H
print(h_date.getShortMonthName()); //Rab1
print(h_date.getLongMonthName()); //Rabi' al-awwal
print(h_date.lengthOfMonth); // 29 days
Check if date is valid
  //
  var _check_date = HijriCalendar();
  _check_date.hYear = 1439;
  _check_date.hMonth = 11;
  _check_date.hDay = 30;
  print(_check_date.isValid()); // false -> This month is only 29 days
From Ummalqura to Gregorian
  //From Ummalqura to Gregorian
  var g_date = HijriCalendar();
  print(g_date.hijriToGregorian(1415, 7, 27)); //1994-12-29 00:00:00.000
Format
  var _format = HijriCalendar.now();
  print(_format.fullDate()); //Thulatha, Ramadan 14, 1439 h
  print(_format.toFormat("mm dd yy")); //09 14 39
Compare
  //Suppose current hijri data is: Thulatha, Ramadan 14, 1439 h
  print(_today.isAfter(1440, 11, 12)); // false
  print(_today.isBefore(1440, 11, 12)); // true
  print(_today.isAtSameMomentAs(1440, 11, 12)); // false

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト