nehakadam / AnyPicker

jQuery Picker Library for Android, iOS & Windows Phone. eg Date Picker, Time Picker, DateTime Picker, Custom Select etc
https://nehakadam.github.io/AnyPicker/
MIT License
116 stars 37 forks source link

is there any way to use AnyPicker to ionic 2 project #17

Open niravjadatiya opened 7 years ago

niravjadatiya commented 7 years ago

hello, currently i am working on ionic 2 project and i want to use this lib please guide me proper way for installation

jd0048 commented 7 years ago

Same issue please help us

nehakadam commented 7 years ago

I followed following steps to use AnyPicker in ionic3 project :

  1. Created a project using ionic blank template

  2. In assets folder, created "js" folder and added "jquery-1.11.0.min.js" and "anypicker.js" files.

  3. In assets folder, created "css" folder and added "anypicker-all.css" file.

  4. Added following code in "src/index.html" file ( Before main.js file ) -

    <script type="text/javascript" src="assets/js/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="assets/js/anypicker.js"></script>

    <link href="assets/css/anypicker-all.css" rel="stylesheet">
  1. Added following code in "src/pages/home/home.html" file ( Inside ion-content ) -
    <p>Date : </p>
    <input type="text" id="ip-de" readonly>
  2. In "src/pages/home/home.ts" file -

    Added following code after import statements

    declare var $:any;

    Added following code inside constructor function -

    $(document).ready(function()
    {
        $("#ip-de").AnyPicker(
    {
        mode: "datetime",
        dateTimeFormat: "MMMM d, yyyy"
    });
    });

Tried in ionic version : 3.3.0