npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

moots-datetime-picker

v0.5.0

Published

Combination of a calendar datepicker and clock timepicker into one component for ionic 4.

Downloads

56

Readme

About

moots technology is an Adelaide, South Australia based consultancy and software development company with a huge expertise in usage requirements analysis and cloud architecture frameworks for creating modern software solutions. Hereby we prioritise high usability and amazing UX over adding further features.

Optimised Datetime Picker for Ionic

An easy to use and beautiful ionic date & time picker with calendar and clock component for single dates and date ranges. Dark mode supported.

chrome_lQWuHjZYoUchrome_YxnD0GDuyj

chrome_5IxbdCg6t0chrome_cGnmRxHYn8

Versions

| Datetime Picker-Version | Angular-Version | |---|---| | <=0.2.9 | Angular 8 | | >=0.3.0 | Angular 12 |

Live Demo

Please find a live demo on Stackblitz

Notes:

  • Certain features might not work properly on stackblitz - but work in a real project
  • The clock picker is optimised for touch control, thus set your view to a mobile device

Install

Dependencies:

npm i luxon @angular/cdk @angular/flex-layout @angular/animations

The picker:

npm i moots-datetime-picker

Note about time zones

The picker is time zone agnostic. All input is expected to be in UTC, all calculations are done without regard to user time zone and locale, and all output is in UTC. When you select a certain date and time on the picker, you will get that displayed date and time in UTC format. Any locale specific transformations must happen outside of the picker.

Import the MootsPickerModule and dependencies in your AppModule:

@NgModule({
  ...
  imports: [
    IonicModule.forRoot(MyApp),
    FlexLayoutModule,
    BrowserAnimationsModule,
    MootsPickerModule
  ],
  ...
})
export class AppModule {}

Please find below an example as a quick start guide to get the picker running.

Modal

export class DemoModalBasicComponent {
    date = new DateTime();
    dateRange = {
        from: this.date.valueOf(),
        to: this.date.valueOf()
    };

    myCalendar;

  constructor(public modalCtrl: ModalController) {}

  async openCalendar() {
    const options: PickerModalOptions = {
        pickMode: PickMode.RANGE,
        title: 'RANGE',
        defaultDateRange: this.dateRange,
        weekStart: 1,
        step: 4,
        locale: 'de'
    };

    this.myCalendar = await this.modalCtrl.create({
        component: PickerModal,
        componentProps: { options }
    });

    this.myCalendar.present();

    const event: any = await this.myCalendar.onDidDismiss();
    const { data: date, role } = event;

    if (role === 'done') {
      this.startDate = DateTime.fromMillis(event.data.from, { zone: 'Etc/UTC' });
      this.endDate = DateTime.fromMillis(event.data.to, { zone: 'Etc/UTC' });
    }
    console.log(this.startDate);
    console.log(this.endDate);
    console.log('role', role);
  }
}

Component

Coming soon!

Development Notes

To release a new version, commit all your changes and run:

  • npm version patch to increment the version
  • npm run packagr to build the library package
  • go into the dist folder and run npm publish to pubish it to npmjs