holiday_in 0.0.1 copy "holiday_in: ^0.0.1" to clipboard
holiday_in: ^0.0.1 copied to clipboard

Indian Holidays.

This library uses holiday_in as Indian holiday dataset.

Features #

You can Use This Package to know about indian holidays

Getting started #

To use this plugin, add holiday_in as a dependency in your pubspec.yaml file.

Usage #

Use this Package for holidays

import 'package:holiday_in/holiday_in.dart' as holiday_in;
import 'package:intl/intl.dart';

final _formatter = DateFormat('yyyy-MM-dd');

void main(List<String> arguments) {
  final marineDay = DateTime.utc(2020, 7, 23);

  final holiday = holiday_in.getHoliday(marineDay);
  if (holiday == null) {
    throw Exception('holiday mus not be null');
  }
  print('${holiday.date} is ${holiday.nameEn} in Japan.\n');

  final isMarineDayHoliday = holiday_jp.isHoliday(marineDay);
  print(
      'The question whether Marine Day is holiday or not is $isMarineDayHoliday.\n');

  final start = DateTime.utc(2022, 1, 1);
  final end = DateTime.utc(2022, 1, 15);
  final holidays = holiday_in.between(start, end);
  print(
      'Holidays between ${_formatter.format(start)} and ${_formatter.format(end)} are the followings.');
  for (final holiday in holidays) {
    print('- ${holiday.date} is ${holiday.nameEn}');
  }
}

Additional information #

3
likes
130
points
20
downloads

Publisher

unverified uploader

Weekly Downloads

Indian Holidays.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on holiday_in