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

issue #27 Better Countdown Handling #201

Merged
merged 1 commit into from
Feb 3, 2014
Merged

issue #27 Better Countdown Handling #201

merged 1 commit into from
Feb 3, 2014

Conversation

ramyothman
Copy link
Contributor

No description provided.

<span style="width:100px"><%= distance_of_time_in_words_to_now(@campaign.expiration_date).gsub(/\d/, "").gsub("about", "") %> left</span>
<script type="text/javascript">
$(function() {
var date_expiration = '<%= @campaign.expiration_date %>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should use the unix timestamp for this, so @campaign.expiration_date.to_i instead

@liuhenry
Copy link
Contributor

@rmostafa - it looks like there are issues around the timezone conversion from UTC to the client's local time, so I suggested some changes above that could help.

Could we also try to move the inline JS to campaign.js.coffee?

var date_expiration = '<%= @campaign.expiration_date %>';
var date_moment = moment(date_expiration, 'YYYY-MM-DD HH:mm:ss');
var months = date_moment.diff(moment(), 'months');
var refDate = 'Months';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets also use lowercase 'months' for the date descriptors

@liuhenry
Copy link
Contributor

liuhenry commented Feb 3, 2014

+1

liuhenry added a commit that referenced this pull request Feb 3, 2014
@liuhenry liuhenry merged commit 3b5d86e into Crowdtilt:master Feb 3, 2014
@liuhenry liuhenry mentioned this pull request Feb 3, 2014
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.

None yet

2 participants