Skip to content

Save time data to element#110

Open
smizell wants to merge 5 commits into
rmm5t:masterfrom
smizell:save_time_data_to_element
Open

Save time data to element#110
smizell wants to merge 5 commits into
rmm5t:masterfrom
smizell:save_time_data_to_element

Conversation

@smizell

@smizell smizell commented Jan 24, 2013

Copy link
Copy Markdown

I was needing to use the time data from this plugin for other calculations, and since it had already calculated seconds, hours, days, and years, I exposed that data along with the datetime in element.data('timeago'). I figured this was better since it was not doing all of those calculations over again.

With this, you can access the data like this (example):

element.data('timeago').datetime // Same as usual
element.data('timeago').inWords; // 3 days ago
element.data('timeago').days; // 3

This also updates the tests.

@rmm5t

rmm5t commented Jan 24, 2013

Copy link
Copy Markdown
Owner

This looks like it breaks the automatic refreshing of fuzzy timestamps values as time passes each minute.

@smizell

smizell commented Jan 24, 2013

Copy link
Copy Markdown
Author

I believe you're right, as those values are only calculated on the initial creation.

@smizell

smizell commented Jan 24, 2013

Copy link
Copy Markdown
Author

I thought I had fixed it, but I had not. I was looking at the wrong version. Sorry about the confusion.

I'll continue looking at this, but at this point, it's still broken.

@smizell

smizell commented Feb 12, 2013

Copy link
Copy Markdown
Author

Just wanted to let you know this is working for us now in case you were interested in it. If not, feel free to close!

Thanks for this awesome plugin! It's been a huge help!

@rmm5t

rmm5t commented Feb 12, 2013

Copy link
Copy Markdown
Owner

@smizell Oh. So sorry. I missed the extra code commit come through. I'll take a peek as soon as I get a chance. Thanks for the nudge.

@smizell

smizell commented Feb 12, 2013

Copy link
Copy Markdown
Author

No problem at all. I wasn't really for sure if you got notified when I did a commit, so I wanted to followup in case.

I also corrected a small mistake where I did not use var with a variable. I just noticed it.

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants