pikaday 1.2.0+1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 21

pikaday

package:js bindings for Pikaday by David Bushnell.

This includes a version of Pikaday with time support

Usage

main() {
  new Pikaday(new PikadayOptions(
    field: document.getElementById('datepicker'),
    firstDay: 1,
    minDate: new DateTime.now(),
    maxDate: new DateTime(2020, 12, 31),
    yearRange: [2000, 2020],
    showTime: false,
  ));
}

Generating the library

dart_js_facade_gen lib/pikaday.d.ts > lib/pikaday.dart

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

1.2.0

  • add helper method: setDate as milliseconds on pikaday
  • add helper method: setMinDate as milliseconds on pikaday
  • add helper method: setMaxDate as milliseconds on pikaday

1.1.0

  • add helper method: get milliseconds from pikaday

1.0.0

  • Initial version

example/main.dart

// Copyright (c) 2017, john. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'dart:html';
import 'dart:js';
import 'package:pikaday/pikaday.dart';
import 'package:pikaday/pikaday_dart_helpers.dart';
import 'package:js/js.dart';

main() {
  new Pikaday(new PikadayOptions(
    field: document.getElementById('datepicker'),
    firstDay: 1,
    minDate: new DateTime.now(),
    maxDate: new DateTime(2020, 12, 31),
    yearRange: [2000, 2020],
    showTime: false,
  ));

  new Pikaday(new PikadayOptions(
      field: document.getElementById('datetimepicker'),
      firstDay: 1,
      minDate: new DateTime(2000, 0, 1),
      maxDate: new DateTime(2020, 12, 31),
      yearRange: [2000, 2020],
      showTime: true,
      autoClose: false,
      use24hour: false));

  Pikaday manual;
  void handleDateSelected() {
    var ms = getPikadayMillisecondsSinceEpoch(manual);
    var date = new DateTime.fromMillisecondsSinceEpoch(ms);
    print(date);
  }

  manual = new Pikaday(new PikadayOptions(
      field: document.getElementById('manualpicker'),
      firstDay: 1,
      minDate: new DateTime(2000, 0, 1),
      maxDate: new DateTime(2020, 12, 31),
      yearRange: [2000, 2020],
      showTime: true,
      autoClose: false,
      use24hour: false,
      onClose: allowInterop(handleDateSelected)));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  pikaday: ^1.2.0+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:pikaday/pikaday.dart';
  
Version Uploaded Documentation Archive
1.2.0+1 Feb 2, 2018 Go to the documentation of pikaday 1.2.0+1 Download pikaday 1.2.0+1 archive
1.2.0 Dec 1, 2017 Go to the documentation of pikaday 1.2.0 Download pikaday 1.2.0 archive
1.1.0 Mar 8, 2017 Go to the documentation of pikaday 1.1.0 Download pikaday 1.1.0 archive
1.0.0 Jan 10, 2017 Go to the documentation of pikaday 1.0.0 Download pikaday 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
43
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
21
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0