Skip to main content

apiverve_datecalculator 1.2.3 copy "apiverve_datecalculator: ^1.2.3" to clipboard
apiverve_datecalculator: ^1.2.3 copied to clipboard

Date Calculator computes the difference between two calendar dates in minutes, hours, days, weeks, months, and years. Supply start and end dates in YYYY-MM-DD format to receive exact interval breakdowns.

Date Calculator API - Dart/Flutter Client #

Date Calculator computes the difference between two calendar dates in minutes, hours, days, weeks, months, and years. Supply start and end dates in YYYY-MM-DD format to receive exact interval breakdowns.

pub package License: MIT

This is the Dart/Flutter client for the Date Calculator API.

Installation #

Add this to your pubspec.yaml:

dependencies:
  apiverve_datecalculator: ^1.2.3

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage #

import 'package:apiverve_datecalculator/apiverve_datecalculator.dart';

void main() async {
  final client = DatecalculatorClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'start': '2022-01-01',
      'end': '2024-08-31'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response #

{
  "status": "ok",
  "error": null,
  "data": {
    "minutes": 524160,
    "hours": 8736,
    "days": 364,
    "weeks": 52,
    "months": 11,
    "years": 0,
    "start": {
      "date": "2022-01-01",
      "day": "Saturday",
      "month": "January",
      "year": "2022",
      "words": "Saturday, January 1st 2022"
    },
    "end": {
      "date": "2022-12-31",
      "day": "Saturday",
      "month": "December",
      "year": "2022",
      "words": "Saturday, December 31st 2022"
    }
  }
}

API Reference #

Authentication #

All requests require an API key. Get yours at apiverve.com.

License #

MIT License - see LICENSE for details.


Built with Dart for APIVerve

0
likes
120
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Date Calculator computes the difference between two calendar dates in minutes, hours, days, weeks, months, and years. Supply start and end dates in YYYY-MM-DD format to receive exact interval breakdowns.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_datecalculator