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

calendarium

v0.3.3

Published

React datetime picker

Downloads

5

Readme

calendarium

calendarium is a React component for a datetime picker or just a calendar on your page.

Notice: From 0.3.3 version you have to explicitly import/connect the file dist/calendarium.css in your project.

Notice: This is currently a 0.x version. What this actually means is that it works in our project but we're too busy to write tests to be sure that it'll work in your project, too.

Install

npm

npm install calendarium --save

browser bundle

The browser bundle exposes a global Calendarium variable and expects to find a global React (>= 0.14.0) variable to work with.

Usage

There are several approaches to use calendarium:

browser bundle

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="/calendarium.css"/>
    <script src="http://fb.me/react-0.14.0.js"></script>
    <script src="http://fb.me/react-dom-0.14.0.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
    <script src="https://npmcdn.com/[email protected]"></script>
</head>
<body>
    <div id="example"></div>
    <script type="text/babel">
    
      var DatePicker = Calendarium.DatePicker;
      
      ReactDOM.render(
        <DatePicker id="myCDP1"/>,
        document.getElementById('example')
      );
    </script>
</body>
</html>

webpack + ES5 (withowt JSX)

var React = require('react');
var ReactDOM = require('react-dom');
require ('calendarium/dist/calendarium.css');

var DatePicker = require('calendarium').DatePicker;

var myCDP1 = React.createElement(DatePicker, { id: "myCDP1" });

ReactDOM.render(
    myCDP1, 
    document.getElementById('datepicker')
);

webpack + ES2015 or TypeScript

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import {DatePicker} from 'calendarium';
import 'calendarium/dist/calendarium.css';


ReactDOM.render(<DatePicker id="myCDP1"/>, document.getElementById('datepicker'));

Change language (now are English and Russian)

browser bundle

You can just set new parameters with Calendarium.DateUtilities.loadLocale method:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="/calendarium.css"/>
    <script src="http://fb.me/react-0.14.0.js"></script>
    <script src="http://fb.me/react-dom-0.14.0.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
    <script src="https://npmcdn.com/[email protected]"></script>
</head>
<body>
    <div id="example"></div>
    <script type="text/babel">
          Calendarium.DateUtilities.loadLocale({
            "name": "ru",
            "format": "dd.MM.YYYY HH:mm",
            "close": "Закрыть",
            "now": "Сейчас",
            "months": [
                "Январь",
                "Февраль",
                "Март",
                "Апрель",
                "Май",
                "Июнь",
                "Июль",
                "Август",
                "Сентябрь",
                "Октябрь",
                "Ноябрь",
                "Декабрь"
            ],
            "week": [
                {"name":"Пн", "class":"weekday"},
                {"name":"Вт", "class":"weekday"},
                {"name":"Ср", "class":"weekday"},
                {"name":"Чт", "class":"weekday"},
                {"name":"Пт", "class":"weekday"},
                {"name":"Сб", "class":"weekend"},
                {"name":"Вс", "class":"weekend"}
            ]
        });
    
      var DatePicker = Calendarium.DatePicker;
      
      ReactDOM.render(
        <DatePicker id="myCDP1"/>,
        document.getElementById('example')
      );
    </script>
</body>
</html>

webpack + ES2015 or TypeScript

import * as React from 'react';
import * as ReactDOM from 'react-dom';

import 'calendarium/dist/calendarium.css';
import * as Calendarium from 'calendarium';
const ru = require('calendarium/dist/locale/ru.json');


Calendarium.DateUtilities.loadLocale(ru);

let DatePicker = Calendarium.DatePicker;

ReactDOM.render(<DatePicker id="myCDP1"/>, document.getElementById('datepicker'));