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

パッケージ詳細v1.0.6

buddhist_datetime_dateformat

DateTime の年をブッダ暦形式で取得するのを開発者に助ける Dart パッケージであり、DateFormatter もサポートしています

30日間ダウンロード
77
いいね数
24
Pub ポイント
30

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

flutter pub add buddhist_datetime_dateformat

パッケージ概要

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

タイやその他の東南アジア諸国で一般的に使用されているブッダ暦システムに、DateTime値を変換およびフォーマットする機能を提供するDartパッケージです。ブッダ暦の年における一貫した日付フォーマットを実現するDateFormatterユーティリティを提供しています。このパッケージはFlutterアプリケーションでのブッダ時代の日付処理を簡素化し、さまざまな地域での正確な表現を保証します。既存の日付操作とのシームレスな統合をサポートしており、ブッダ暦を使用する地域のユーザーをターゲットとするアプリに最適です。

用途

  • グレゴリオ暦から仏教暦への変換
  • 仏教暦形式での日付の書式設定
  • 地域固有のカレンダーアプリの構築
  • タイまたは仏教暦形式で日付を表示する
  • 多言語日付表示のサポート

主な機能

  • DateTime を仏教暦の年へ変換します
  • DateFormatter ユーティリティを含む
  • ブッダ紀元のローカライゼーションをサポート
  • Flutter との簡単な統合
  • グレゴリオ暦からの正確な年数のずれ

適している対象

  • タイまたは東南アジアをターゲットとしたFlutterアプリ
  • 仏教暦のサポートを必要とするアプリ
  • 地域の日付形式を使用する開発者
  • カレンダーおよびスケジューリングアプリケーション
  • 国際化された日付処理

注意事項

  • 月/日の境界を手動で処理する必要があります
  • 仏教暦の変換のみ対応
  • 組み込みのタイムゾーンサポートなし
  • 仏教暦以外の暦システムには適していません
  • 正確なグレゴリオ暦の入力に依存して正確な変換を行う

元の README

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

Buddhist Calendar DateTime and DateFormatter for Dart and Flutter

If this helps you out of problem, please give it a like in pub.dev or a star on github. :smile:

ภาษาไทยอ่านวิธีใช้ที่นี่นะครับ

2020-06-05_17-31-47

These are extension that you can get DateTime and DateFormat in Buddhist calendar's format.

I implemented these extensions for use in Thai language project. But you can contribute to add more support for other countries who also use Buddhist calendar in the apps.

Getting Started

1. Setup

Install package via pubspec.yaml

dependencies:
  intl: ^0.16.1  
  buddhist_datetime_dateformat: ^1.0.1

2. Initialization

Then go to your main.dart. Let's import and write some Initialization code.

// need this for `Intl.defaultLocale = "th";`
import 'package:intl/intl.dart';
// need this for initializeDateFormatting()
import 'package:intl/date_symbol_data_local.dart';

// This lets magic happen!
import 'package:buddhist_datetime_dateformat/buddhist_datetime_dateformat.dart';

void main() {

  // set your default locale here. It will be applied to DateFormat autmomatically.
  Intl.defaultLocale = "th";
  initializeDateFormatting();

  runApp(MyApp());
}

3. Use it

  • You will found .yearInBuddhistCalendar property in DateTime's instance. This will return converted year value into Buddhist era.
  • Also .formatInBuddhistCalendarThai(datetime) method in DateFormat which return correct format for Thai language if you pass DateTime's instance into it.
var now = DateTime.now();
var onlyBuddhistYear = now.yearInBuddhistCalendar;

var formatter = DateFormat.yMMMMEEEEd();
var dateInBuddhistCalendarFormat = formatter.formatInBuddhistCalendarThai(now);

Open for contribution

If you want to contribute, there are several countries that also use Buddhist calendar:

  • Thailand
  • Cambodia
  • Laos
  • MyanMar
  • Sri Lanka
  • Malaysia
  • Singapore

Reference: https:en.wikipedia.org/wiki/Buddhist_calendar

I don't know other langauge need a prefix for Buddhist year like in Thailand (พ.ศ.). If yes, so you can help me correct their format by update the code with your customization. Just make pull request.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

データはまだありません。