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

Initial value unix epoch #217

Open
Tampa opened this issue Apr 8, 2023 · 1 comment
Open

Initial value unix epoch #217

Tampa opened this issue Apr 8, 2023 · 1 comment

Comments

@Tampa
Copy link

Tampa commented Apr 8, 2023

Putting the epoch into the value part of the input I get it converted when I click on the field(not automatically though), but placing it inside initialValue: for rome the input field remains blank. It seems to fetch it fine as soon as I click the field, but doesn't initially populate anything.

<input id="datetime" class="input" data-rome-id="0">

document.addEventListener('DOMContentLoaded', initload, false);

function initload () {
	rome(datetime, { initialValue: '<?php echo $dateUTC; ?>' });
}

What am I doing wrong here?

@Tampa
Copy link
Author

Tampa commented Apr 14, 2023

I had to solve this by adding the timezone offset from moment to the return form. How is it that it simply cannot "just" convert a unix epoch to that particular time without using javascript's time objects, which get localized. Moment already supports changing timezones to force UTC, so adding an option to rome to force a certain timezone should be relatively easy?

Though it would seem this project isn't maintained anymore? @bevacqua

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

1 participant