Git Product home page Git Product logo

calendar_recurrence's Introduction

This is a fork of the dart-grec-minimal package

  • Find the original here:
  • The motivation to fork rather than contribute is simply that I will tweak it to my use case. I recommend you use the original package.

NB: The rest of this Readme is the original readme from the original package.

grec_minimal Build Status

A minimal parser/generator of Google Calendar recurrence rule for dart.

Synopsis

Parse recurrence rule text(s)

import 'package:grec_minimal/grec_minimal.dart';

void main() {
  final List<String> recurrenceRuleTexts = [
    'RRULE:FREQ=DAILY',
    // put recurrence rule texts
  ];

  List<RecurrenceRule> rules;
  try {
    rules = GrecMinimal.fromTexts(recurrenceRuleTexts);
  } catch (ex) {
    // There is possibility to occur InvalidSyntaxException and/or ConditionalException
    // do something
    rethrow;
  }

  rules.forEach((rule) {
    // do something
    print(rule.asRuleText());
  });
}

Dump recurrence rule text(s) from rule object(s)

import 'package:grec_minimal/grec_minimal.dart';

void main() {
  final List<String> ruleTexts = GrecMinimal.toTexts([
    new RecurrenceRule(Frequency.DAILY, 123, null, 2, null),
    // put recurrence rule object as you like
  ]);

  ruleTexts.forEach((ruleText) {
    // do something
    print(ruleText);
  });
}

See also: example/

Description

grec_minimal is a simple parser/generator of recurrence rule for Google Calendar.

This library provides two funnctions:

  • A parsing function of recurrence rule text(s) that is generated by Google Calendar. It outputs recurrence rule object(s) according to give text(s).
  • A generating function of recurrence rule text(s) from give rule object(s).

i.e. This library is an implementation of a subset of RFC 5545.

Disclaimer

This is not a full implementation of RFC 5545. This library is focused on using Google Calendar. It means some features are not supported (e.g. SECONDLY, MINUTELY).

So if you need full implementation of RFC 5545, please consider other libraries.

License

The MIT License (MIT)
Copyright © 2018 moznion, http://moznion.net/ <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

calendar_recurrence's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.