Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to to add 1 hour current inputTime #74

Closed
muhsin-k opened this issue Apr 14, 2016 · 4 comments
Closed

Unable to to add 1 hour current inputTime #74

muhsin-k opened this issue Apr 14, 2016 · 4 comments

Comments

@muhsin-k
Copy link

muhsin-k commented Apr 14, 2016

I want add 1 hour to current time for showing inputEpochTime as this time.How to do that?

@rajeshwarpatlolla
Copy link
Owner

While passing the inputTime, you can add one hour(60*60 seconds) and pass it to the ionicTimePicker.openTimePicker(<object>) method.

@muhsin-k
Copy link
Author

If i add ((new Date()).getHours()) + (60 * 60) to inputEpochTime.It is showing 01:00 time.Similarly
((new Date()).getHours()) + (60 * 60_2)--->02:00
((new Date()).getHours()) + (60 * 60_3)--->03:00 etc.
(Here the current time is 18:00 ).Can i get the display time as by adding one hour to current utc time?

@rajeshwarpatlolla
Copy link
Owner

rajeshwarpatlolla commented Apr 14, 2016

You need to pass inputTime: (((new Date()).getHours() * 60 * 60) + (60*60)

@muhsin-k
Copy link
Author

My controller code is,


$scope.timePickerObject = {
    // inputEpochTime: ((new Date()).getHours() + (30 * 60 * 1000)), //Optional
    inputEpochTime: (((new Date()).getHours() * 60 * 60) + (60 * 60)),
    step: 5, //Optional
    format: 24, //Optional
    titleLabel: 'Enter Departure Time in UTC', //Optional
    setLabel: 'OK', //Optional
    closeLabel: 'CANCEL', //Optional
    setButtonType: 'button-positive', //Optional
    closeButtonType: 'button-stable', //Optional
    callback: function(val) { //Mandatory
        timePickerCallback(val);
    }
};

If the current time is 03:40:00,the time picker is showing 10:00 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants