Skip to content

Commit

Permalink
fix issue with favorite on Firefox + now date on avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeBredin committed Jan 19, 2016
1 parent 94dc4d6 commit 592c016
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/js/favorite.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ function getCookie(sName) {


function changeFavorite(e){
var button = e.srcElement.parentNode;
var button = e.currentTarget;
var isFavorite = button.class === 'place-favorite';
button.class = isFavorite ? 'place-no-favorite' : 'place-favorite';
e.srcElement.src = isFavorite ? '../img/no-favorite.svg' : '../img/favorite.svg';
e.currentTarget.firstChild.src = isFavorite ? '../img/no-favorite.svg' : '../img/favorite.svg';
var id = button.id.replace('register-','');
var cookie_places = getCookie('6element-places') || '';
if(isFavorite) setCookie('6element-places', cookie_places.replace(id + ';',''));// remove place in cookie
Expand Down
4 changes: 3 additions & 1 deletion client/views/placeView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ module.exports = React.createClass({
// OPENING HOURS
var oh = place.opening_hours === null ? undefined :
new opening_hours(place.opening_hours);
var now = fromUTC(momentTZ().tz('Europe/Paris').format());
var now = new Date(momentTZ().tz('Europe/Paris').format());
//console.log(now);
//var now = fromUTC(momentTZ().tz('Europe/Paris').format());

var isOpen = oh ? oh.getState(now) : true;
var calendarJSX = NotEmpty(place.opening_hours) ?
Expand Down

0 comments on commit 592c016

Please sign in to comment.