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

Fix to resource cal reservable before pop up text #350

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { injectT } from 'i18n';
import { scrollTo } from 'utils/domUtils';
import { padLeft } from 'utils/timeUtils';
import { isSlotReservable } from '../utils';
import { getNaiveDate } from '../../../../utils/resourceUtils';

class TimeSlot extends PureComponent {
static propTypes = {
Expand Down Expand Up @@ -163,7 +164,7 @@ class TimeSlot extends PureComponent {
}
if (resource.reservableBefore && moment(slot.start).isAfter(resource.reservableBefore)) {
const dateFormat = 'D.M.YYYY';
const lastDate = moment(resource.reservableBefore).subtract(1, 'day').format(dateFormat);
const lastDate = moment(getNaiveDate(resource.reservableBefore), 'YYYY-MM-DD').subtract(1, 'day').format(dateFormat);
const msg = `${t('ReservingRestrictedText.reservationRestricted', { days: resource.reservableDaysInAdvance })} ${t('Notifications.reservableLastDay', { date: lastDate })}`;
return {
message: msg,
Expand Down
Loading