Coder Social home page Coder Social logo

aymanalhattami / bootstrap4-datetimepicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from technovistalimited/bootstrap4-datetimepicker

0.0 1.0 0.0 3.42 MB

Eonasdan's DateTimePicker made Bootstrap 4 compatible

Home Page: http://eonasdan.github.io/bootstrap-datetimepicker/

bootstrap4-datetimepicker's Introduction

Bootstrap DateTimePicker for Bootstrap 4

100% Compatible with Bootstrap 4.3.1

This is a forked version of wgbbiao/bootstrap4-datetimepicker which was a forked version of the original Bootstrap 3 DateTimePicker by Eonasdan. We found that, the wgbbiao's version is not working in our BS4 environment. So we fixed some things.

Here we are serving only the necessary built files from the base repos for our use in BS4 environment. What we did is simple: simply replaced the BS3 classes for collapsibles from in to show. And that's it. Without build system, we minified the JS with javascript-minifier.com.

We did nothing in the CSS but removed the standalone.css.

We are serving the files under the /build directory and serving nothing else. You can follow any of the original versions if you need.

Table of Contents

Dependencies

  • jQuery
  • Bootstrap 4
  • Moment JS (Download)

How to use

Installation

  • Bootstrap 4 CSS
  • Bootstrap Datetimepicker CSS

In <head> load the stylesheets.

<head>
    <!-- Bootstrap 4 CSS Here -->

    <link rel="stylesheet" type="text/css" href="assets/css/libs/bootstrap-datetimepicker.css">
</head>
  • jQuery
  • Moment JS
  • Bootstrap Datetimepicker JS

Before </body> load the javascripts.

    <!-- jQuery and Bootstrap JS with their dependencies here -->

    <script src="assets/js/libs/moment.min.js"></script>
    <script src="assets/js/libs/bootstrap-datetimepicker.min.js"></script>
</body>

Basic usage

For the library methods and detailed documentation, please follow the original documentation here:
ORIGINAL DOCUMENTATION

jQuery(document).ready(function($) {
    if (window.jQuery().datetimepicker) {
        $('.datetimepicker').datetimepicker({
            // Formats
            // follow MomentJS docs: https://momentjs.com/docs/#/displaying/format/
            format: 'DD-MM-YYYY hh:mm A',
            
            // Your Icons
            // as Bootstrap 4 is not using Glyphicons anymore
            icons: {
                time: 'fa fa-clock-o',
                date: 'fa fa-calendar',
                up: 'fa fa-chevron-up',
                down: 'fa fa-chevron-down',
                previous: 'fa fa-chevron-left',
                next: 'fa fa-chevron-right',
                today: 'fa fa-check',
                clear: 'fa fa-trash',
                close: 'fa fa-times'
            }
        });
    }
});

Why din't we make a pull request?

Because the original Eonasdan's version is unmaintained for years. And we're in a rush, and did this in a mid-point of a project, so have not much time to go for a proper PR. :)

Thanks

Thanks to Eonasdan for the awesome library. Thanks to ้ž่‰ฏ (wgbbiao) for their fork too. Thanks to Camille Anelli's blog for the reminder about the icons.


TechnoVista Limited 20190909174850/sup>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.