패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.0.6

buddhist_datetime_dateformat

개발자가 DateTime의 연도를 부처력 형식으로 얻는 데 도움을 주는 다트 패키지이며, DateFormatter도 지원합니다

30일 다운로드
77
좋아요
24
Pub 점수
30

패키지 설치

flutter pub add buddhist_datetime_dateformat

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

태국 및 기타 동남아시아 국가에서 일반적으로 사용되는 불교력 시스템으로 DateTime 값을 변환하고 형식화할 수 있게 해주는 Dart 패키지입니다. 불교 연도에서 일관된 날짜 형식을 제공하는 DateFormatter 유틸리티를 제공합니다. 이 패키지는 Flutter 앱에서 불교 시대 날짜를 다루는 것을 간소화하며, 다양한 지역에서 정확한 표현을 보장합니다. 기존의 날짜 작업과 원활하게 통합되며, 불교력 사용 지역의 사용자를 대상으로 하는 앱에 이상적입니다.

사용 사례

  • 그레고리력 날짜를 불교력으로 변환
  • 불교 연도 형식으로 날짜 포맷팅
  • 지역별 캘린더 앱 구축
  • 태국 또는 불교 기원 형식으로 날짜 표시
  • 다국어 날짜 표시 지원

주요 기능

  • DateTime를 부처님 오신 해 연도로 변환합니다
  • DateFormatter 유틸리티 포함
  • 불교 기원의 현지화를 지원
  • 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 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.