Fix digest date issues

Fix today and yesterday offsets
Use current date in empty post list error
This commit is contained in:
Cory Fabre 2014-07-07 23:25:53 -05:00
parent 7b5528b59f
commit f7594403b7
3 changed files with 4 additions and 3 deletions

View file

@ -19,7 +19,7 @@
</div>
{{else}}
<div class="grid-small grid-block dialog">
<p>{{i18n "Sorry, no posts for today"}}.</p>
<p>{{i18n "Sorry, no posts for"}} {{currentDate}}.</p>
</div>
{{/if}}
</template>

View file

@ -23,9 +23,9 @@ Template[getTemplate('posts_digest')].helpers({
var currentDate=moment(Session.get('currentDate'));
var today=moment(new Date());
var diff=today.diff(currentDate, 'days');
if(diff === 1)
if(diff === 0)
return i18n.t("Today");
if(diff === 2)
if(diff === 1)
return i18n.t("Yesterday");
return currentDate.format("dddd, MMMM Do YYYY");
},

View file

@ -53,6 +53,7 @@ i18n.translations.en = {
"Previous Day": "Previous Day",
"Next Day": "Next Day",
"Sorry, no posts for today": "Sorry, no posts for today",
"Sorry, no posts for": "Sorry, no posts for",
"Today": "Today",
"Yesterday": "Yesterday",