File: jquery-amd.html

package info (click to toggle)
node-pikaday 1.8.2%2B~1.7.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 484 kB
  • sloc: javascript: 1,226; makefile: 8
file content (54 lines) | stat: -rwxr-xr-x 1,934 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
    <title>Pikaday - jQuery + AMD example</title>
    <meta name="author" content="Ramiro Rikkert">
    <link rel="stylesheet" href="../css/pikaday.css">
    <link rel="stylesheet" href="../css/site.css">
</head>
<body>
    <a href="https://github.com/Pikaday/Pikaday">Pikaday source on GitHub</a>

    <h1>Pikaday - jQuery + AMD example</h1>

    <p class="large">A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS.</p>

    <label for="datepicker">Date:</label>
    <br>
    <input type="text" id="datepicker">

    <h2>What is this?</h2>

    <p>Since version 1.0 Pikaday is a stable and battle tested date-picker. Feel free to use it however you like but please report any bugs or feature requests to the <a href="https://github.com/Pikaday/Pikaday/issues">GitHub issue tracker</a>, thanks!</p>

    <p class="small">Copyright © 2014 <a href="https://dbushell.com/">David Bushell</a> | BSD &amp; MIT license | Example by <a href="https://github.com/rikkert">Ramiro Rikkert</a></p>


    <script src="../../requirejs/require.js"></script>
    <script>

    require.config({
        baseUrl: '../',
        // To get timely, correct error triggers in IE, force a define/shim exports check.
        enforceDefine: true,
        paths: {
            jquery: '../../jquery/dist/jquery.min'
        }
    });
    require(['jquery', 'plugins/pikaday.jquery'], function($)
    {
        var $datepicker = $('#datepicker').pikaday({
            firstDay: 1,
            minDate: new Date(2000, 0, 1),
            maxDate: new Date(2020, 12, 31),
            yearRange: [2000,2020]
        });
        // chain a few methods for the first datepicker, jQuery style!
        $datepicker.pikaday('show').pikaday('nextMonth');
    });

    </script>
</body>
</html>