Comments (4)
It depends on the callback function you are passing in the object. Can you show me your code?
from ionic-timepicker.
$scope.timepickerSettings1 = {
format: 12,
step: 1,
callback: function(val) {
if (typeof (val) === 'undefined') {
} else {
var selectedTime = new Date(val * 1000);
$scope.parkingSpace.availableFrom = selectedTime.getUTCHours()+":"+selectedTime.getUTCMinutes();
$scope.parkingSpace.from = val;
}
}
};
$scope.timepickerSettings2 = {
format: 12,
step: 1,
callback: function(val) {
if (typeof (val) === 'undefined') {
} else {
var selectedTime = new Date(val * 1000);
$scope.parkingSpace.availableTo = selectedTime.getUTCHours()+":"+selectedTime.getUTCMinutes();
$scope.parkingSpace.to = val;
}
}
};
In my template:
<div class="col">
<ionic-timepicker input-obj="timepickerSettings1">
<button class="button button-block button-positive overflowShow">
<i class="icon ion-clock"></i> Available from <span>{{parkingSpace.availableFrom}}</span>
</button>
</ionic-timepicker>
</div>
<div class="col">
<ionic-timepicker input-obj="timepickerSettings2">
<button class="button button-block button-positive">
<i class="icon ion-ios-arrow-thin-right"></i> Until <span>{{parkingSpace.availableTo}}</span>
</button>
</ionic-timepicker>
</div>
No matter what button I press, the first one is the only one that changes. It's really bizarre.
from ionic-timepicker.
It should not happen. You can check the demo link i mentioned in the repo. There i am using two components. But the callbacks are working fine. Print a console and check it, where the control is entering.
from ionic-timepicker.
Yeah I have printed to console to see if the second one is being called, and it isn't. I just checked your example though and I do see it working there, so I'm baffled. I'll close this issue since it's clear that you can have two timepickers. Maybe the surrounding markup is causing issues in Angular or something.
from ionic-timepicker.
Related Issues (20)
- 24 hrs format not working properly HOT 7
- Can't build project - Resulting minified file is "broken" HOT 3
- How to disable past time and meridians too HOT 1
- File references in index.html HOT 1
- Random minute display HOT 1
- Customize Popup
- v0.6.0 is not on NPM yet HOT 1
- Minute arrows not visible. HOT 1
- Max time HOT 1
- Issue with local time HOT 1
- How to disable previous dates?
- How to get AM PM with time?
- Display 00:00 AM in place of 12:00 AM HOT 1
- Limit first and last hour HOT 1
- How can I display just 00:10 ??? any setup showing 12:10... I need Select just 10 seconds. HOT 1
- Issue - Need to press Set button twice for the modal to close
- Time picker is allowing alphabets and character as input.
- Callback on close
- how to use in ionic 2 HOT 1
- Not syncing with ionic2-calendar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-timepicker.