Observer
Observer

Reputation: 3706

Ionic v1 type="date"

I have a simple example of an ionic v1 app with input type date. My code is:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <link href="https://code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
    <script src="https://code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
  </head>
  <body ng-app="app">
    <ion-pane>
      <ion-header-bar class="bar-stable">
        <h1 class="title">Awesome App</h1>
      </ion-header-bar>
      <ion-content class="padding">
        <input type="date">
      </ion-content>
    </ion-pane>
  </body>
</html>

And link to code above is here

Problem is to show calendar picker. If I will put

<input type="date">

in the jsfiddle, calendar picker works fine as a regular HTML tag.

Chrome version: Version 59.0.3071.115 (Official Build) (64-bit)

Ionic examples works fine in Microsoft Edge. Firefox and IE are not working.

Does somebody know how to show calendar picker for Ionic v1?

Upvotes: 0

Views: 1090

Answers (1)

Dann
Dann

Reputation: 23

It is better to use a directive for the date, for example : HTML

 <ionic-datepicker ng-model="dateFrom">
           <i class="icon calendar"></i>
     </ionic-datepicker>

In this link you find a solution (Directive)

https://github.com/rajeshwarpatlolla/ionic-datepicker

Upvotes: 1

Related Questions