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

datetime-utc dynamically #29

Closed
crazyjat opened this issue May 5, 2016 · 5 comments
Closed

datetime-utc dynamically #29

crazyjat opened this issue May 5, 2016 · 5 comments

Comments

@crazyjat
Copy link

crazyjat commented May 5, 2016

I need the ability to display the time in local time or utc based on a user selection. Is there currently a way to dynamically change the timezone of the input field?

@eight04
Copy link
Owner

eight04 commented May 5, 2016

Currently, no. The timezone is set when linked: https://github.com/eight04/angular-datetime/blob/master/src/directive.js#L199 . It is like a switch to change between input[datetime] and input[datetime-local]. (Note that there is no browser supporting datetime: whatwg/html#336)

Should we implement it?

@crazyjat
Copy link
Author

crazyjat commented May 5, 2016

For now i am using ng-if to switch between 2 versions of the directive, which is not ideal. I might do a pull to add support for it dynamically. It would be very useful if the datetime-utc directive could be triggered by a property.

@eight04
Copy link
Owner

eight04 commented May 5, 2016

Maybe we can create a binding ($watch) if attrs.datetimeUtc is a string and length > 0.

<input ... datetime-utc="aVar">

Then we create a binding to scope.aVar.

@eight04
Copy link
Owner

eight04 commented May 16, 2016

Fixed in 3.2.0.

@eight04 eight04 closed this as completed May 16, 2016
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