jalali Table Calendar

Overview

jalali Table Calendar

if you have any issue or any suggestion you could contact a Calendar , DatePicker and Date Converter For Persian Date(Jalali/Shamsi date) with holidays

Modified and Completed Version of jalali_calendar package



Usage

Import this line in Flutter pubspec.yaml

jalali_table_calendar: ^1.0.2

To Use Calendar Or DatePicker , Import this line to your dart file

import 'package:jalali_table_calendar/jalali_table_calendar.dart';

To Use date Converter , Import this line to your dart file

import 'package:persian_date/persian_date.dart';

After import library, to show the calendar you can use jalaliCalendar or jalaliCalendarPicker() method , on the constructor context is important

This sample make a Calendar Widget

DateTime today = DateTime.now();
jalaliCalendar(
    context: context,
    // add the events for each day
    events: {
        DateTime(2021,4,15):['sample event',66546],
        today: ['sample event'],
        today.add(Duration(days: 1)): [6, 5, 465, 1, 66546],
        today.add(Duration(days: 2)): [6, 5, 465, 66546],
         },
    //make marker for every day that have some events
    marker: (date,events){
        return Positioned(
            top: -4,
            left: 0,
            child: Container(
            decoration: BoxDecoration(
            color: Theme.of(context).textSelectionColor,
            shape: BoxShape.circle),
            padding: const EdgeInsets.all(6.0),
              child: Text(events.length.toString()),
                ),
             );
            },
    onDaySelected: (date) {
        print(date);
         }),

This sample return the selected date as Jalali(شمسی)

if you want to return the selected date to Gregorian, on the constructor set the convertToGregorian to true

Future _selectDate() async {
    String picked = await jalaliCalendarPicker(context: context); // نمایش خروجی به صورت شمسی
   //  await jalaliCalendarPicker(context: context,convertToGregorian: true); // نمایش خروجی به صورت میلادی
    if (picked != null) setState(() => _value =picked.toString());
    print(_value);
  }

This sample return the selected date as Gregorian(میلادی)

Future _selectDate() async {
    String picked = await jalaliCalendarPicker(context: context,convertToGregorian: true); // نمایش خروجی به صورت میلادی
    if (picked != null) setState(() => _value =picked.toString());
    print(_value);
  }

Those parameters using To Show the TimePicker

Parameter operation
showTimePicker To show TimePicker set it true
hore24Format To return time in 24 hours format set it true
initialTime To set initial time use it with TimeOfDay

To use datePicker you can follow this sample

To show DatePicker those parameters is required

minYear // min date this required  for the start year in Jalali
maxYear // max  date this required  for the last year in jalali
confirm and cancel // widget for show text
_format // for returning date like String _format = 'yyyy-mm-dd';
onChanged // return date when the user changes the date
onConfirm //  return date when the user click confirm

For set, default date use those parameters

initialYear => for year
initialMonth => for month
initialDay => for day

Full datePicker Sample

    DatePicker.showDatePicker(
      context,
      minYear: 1300,
      maxYear: 1450,
      confirm: Text(
        'Confirm',
        style: TextStyle(color: Colors.red),
      ),
      cancel: Text(
        'Cancel',
        style: TextStyle(color: Colors.cyan),
      ),
      dateFormat: _format,
      onChanged: (year, month, day) {
        if (!showTitleActions) {
          _changeDatetime(year, month, day);
        }
      },
      onConfirm: (year, month, day) {
        _changeDatetime(year, month, day);
        _valuePiker = " Full date : $_datetime  \n year : $year \n  Month  :   $month \n  day :  $day";
      }
    )

 void _changeDatetime(int year, int month, int day) {
    setState(() {
      _datetime = '$year-$month-$day';
    });
  }

To use date Converter you can follow this sample

first import this library to your code

import 'package:persian_date/persian_date.dart';

Full Date Converter Sample

PersianDate pDate = PersianDate(gregorian: "1989-01-29");
    print("Now ${pDate.getDate}");

    PersianDate persianDate = PersianDate();
    print("Now ${persianDate.now}");
    print(persianDate.hour);
    print("year ${persianDate.year}");
    print("isHoliday ${persianDate.isHoliday}");
    print("isHoliday ${persianDate.weekdayname}");
    print(persianDate.monthname); // نام ماه
      print(persianDate.month); // ماه
      print(persianDate.day); // روز
      print(persianDate.hour);// ساعت
      print(persianDate.minute);// دقیقه
      print(persianDate.second);// ثانیه
      print(persianDate.millisecond); // میلی ثانیه
      print(persianDate.microsecond);//


print("Parse Gregorian To Jalali ${persianDate.gregorianToJalali("2019-02-20T00:19:54.000Z","yyyy-m-d hh:nn")}");
print("Parse Jalali To Gregorian ${persianDate.jalaliToGregorian("1368-05-30 19:54", "yyyy-m-d hh:nn")}");

those formats are supported in date converter

   `"2012-02-27 13:27:00"`
    `"2012-02-27 13:27:00.123456z"`
    `"2012-02-27 13:27:00,123456z"`
    `"20120227 13:27:00"`
    `"20120227T132700"`
    `"20120227"`
    `"+20120227"`
    `"2012-02-27T14Z"`
    `"2012-02-27T14+00:00"`
    `"-123450101 00:00:00 Z"`: in the year -12345.
    `"2002-02-27T14:00:00-0500"`: Same as `"2002-02-27T19:00:00Z"`
Format operation Format operation
yyyy return year with Four number hh hours with two number
yy return year with two number h hours with one number
mm return month with two number HH hours with two number in 24
m return month with one number H hours with one number in 24
MM the month name with full letter nn minut with two number
M the month name with short form n minut with one number
dd the day with two number ss Second with two number
d the day with one number s Second with one number
w week number SS show milliSecond
DD the day name with full letter S show milliSecond
D the day name with short form uuu show microsecond
am Show time in short u show microsecond
AM Show full time . .

bug report and suggestions

if you have any issue or any suggestion you could contact [email protected] or [email protected] author of jalali_calendar package

You might also like...

Calendar widget library for Flutter apps.

Calendar widget library for Flutter apps.

Calendarro Calendar widget library for Flutter apps. Offers multiple ways to customize the widget. Getting Started Installation Add dependency to your

Nov 30, 2022

Flutter Inline Calendar

Flutter Inline Calendar

inline_calendar An inline calendar flutter package inspired by outlook app. It also supports Jalali/Shamsi calendar. Uses theme and locale of context

Oct 21, 2022

A calendar widget for Flutter.

A calendar widget for Flutter.

flutter_calendar A calendar widget for Flutter Apps. Borrowed DateTime utility functions from the Tzolkin Calendar web element. Usage Add to your pubs

Sep 6, 2022

A Heatmap Calendar based on Github's contributions chart

Flutter Heat Map Calendar A Heat Map Calendar based on Github's contributions chart which can be used to visualize values over time Installing 1. Depe

Dec 6, 2022

Flutter calendar week UI package

Flutter calendar week UI package

Flutter calendar week Flutter calendar week UI package IOS | Android: import 'package:flutter_calendar_week/flutter_calendar_week.dart'; CalendarWeek(

Dec 12, 2022

A seasonal foods calendar app written in Dart using Flutter.

A seasonal foods calendar app written in Dart using Flutter.

This project is not actively maintained anymore. However, everybody who wants to do so is more than welcome to work on this project! Thank you for you

Nov 19, 2022

Collection of customisable calendar related widgets for Flutter.

Collection of customisable calendar related widgets for Flutter.

calendar_views Collection of customisable calendar related widgets for Flutter. Day View Day View Documentation Set of widgets for displaying a day vi

Sep 8, 2022

CalendarDatePicker2 - A lightweight and customizable calendar picker based on Flutter CalendarDatePicker

CalendarDatePicker2 - A lightweight and customizable calendar picker based on Flutter CalendarDatePicker

A lightweight and customizable calendar picker based on Flutter CalendarDatePicker, with support for single date picker, range picker and multi picker.

Dec 22, 2022

Fluboard - Calendar wall-board-display built with Flutter and ❤️

Fluboard - Calendar wall-board-display built with Flutter and ❤️

Fluboard Calendar wall-board-display built with Flutter and ❤️ Goals Build calendar board (DAKBoard alternative) which easy to install and easy to cus

Dec 27, 2022
Comments
  • get event text

    get event text

    Hi, thanks for the great package Please guide me how to get the text of the recorded events سلام ممنون بابت پکیج عالی لطفا راهنمایی کنید متن ایونت های ثبت شده رو چطور میتونم دریافت کنم

    opened by mohsen0fc 1
  • localization and change format to persian

    localization and change format to persian

    Hi. Thanks for this useful package. I searched about locale to convert English numbers to persian numbers, but got an error. and I couldnt find any good document for that. سلام و سپاس بابت پکیج مفیدتان. درباره ی تبدیل شماره های انگلیسی به فارسی سرچ کردم و اموری انجام دادم اما ارور دریافت کردم. همچنین منبع خوبی برای پیاده سازی آن پیدا نکردم. ممنون میشم راهنمایی کنید.

    opened by AbbasHoseini 1
Releases(1.0.2)
Owner
Ali Zare
Ali Zare
A Flutter package allows you to easily implement all calendar UI and calendar event functionality. 👌🔝🎉

calendar_view A Flutter package allows you to easily implement all calendar UI and calendar event functionality. For web demo visit Calendar View Exam

Simform Solutions 219 Dec 22, 2022
Flutter calendar app. register schedule and manage in calendar ui.

flutter calendar app. register schedule and manage in calendar ui. save schedule data in firestore. and create widget and read schedule from firestore in widget.

akiho 11 Oct 30, 2022
Highly customizable, feature-packed calendar works like google calendar but with more features.

Beca [In Progress] Beca is a Calendar that you could manage your daily tasks and schedule meetings with your friends just like google calendar Concept

Mohammad Javad Hossieni 19 Nov 15, 2022
a time planner for flutter to show task on table

A beautiful, easy to use and customizable time planner for flutter mobile ?? , desktop ?? and web ??

Mohammad Jamalianpour 150 Dec 21, 2022
Calendar widget for flutter

Calendar Shows a scrolling calendar list of events. This is still relatively basic, it always assumes that the getEvents returns the entire list of ca

null 223 Dec 19, 2022
Highly customizable, feature-packed calendar widget for Flutter

Table Calendar Highly customizable, feature-packed Flutter Calendar with gestures, animations and multiple formats. Table Calendar with custom styles

Aleksander Woźniak 1.5k Jan 7, 2023
Flutter Date Picker Library that provides a calendar as a horizontal timeline.

DatePickerTimeline Flutter Date Picker Library that provides a calendar as a horizontal timeline. How To Use Import the following package in your dart

LiLi 0 Oct 25, 2021
Easy to use and beautiful calendar strip component for Flutter.

Flutter Calendar Strip Easy to use and beautiful calendar strip component for Flutter. Awesome celender widget If this project has helped you out, ple

Siddharth V 176 Dec 14, 2022
A calendar widget to easily scroll through the years 🗓

Flutter Scrolling Calendar A customizable calendar widget to easily scroll through the years. Features Choose range of years and the initial year to s

Menno Renkens 113 Nov 19, 2022
Flutter Date Picker Library that provides a calendar as a horizontal timeline

Flutter Date Picker Library that provides a calendar as a horizontal timeline.

Vivek Kaushik 214 Jan 7, 2023