Skip to content
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
18 changes: 17 additions & 1 deletion app/components/forms/wizard/sessions-speakers-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ import EventWizardMixin from 'open-event-frontend/mixins/event-wizard';
import { groupBy } from 'lodash-es';
import { sortCustomFormFields } from 'open-event-frontend/utils/sort';
import { SPEAKER_FORM_ORDER, SESSION_FORM_ORDER } from 'open-event-frontend/models/custom-form';
import moment from 'moment';
import $ from 'jquery';

export default Component.extend(EventWizardMixin, FormMixin, {

// TODO: Removing the Session & Speaker Time Validations due to the weird and buggy behaviour. Will be restored once a perfect solution is found. Please check issue: https://github.com/fossasia/open-event-frontend/issues/3667
getValidationRules() {
$.fn.form.settings.rules.checkStartDateCFS = () => {
return !(moment($('.ui.form').form('get value', 'start_date')).isAfter(this.data.event.startsAtDate));
};
$.fn.form.settings.rules.checkEndDateCFS = () => {
return !(moment($('.ui.form').form('get value', 'end_date')).isAfter(this.data.event.startsAtDate));
};
return {
inline : true,
delay : false,
on : 'blur',
on : 'change',
fields : {
sessionType: {
identifier : 'session',
Expand Down Expand Up @@ -48,6 +56,10 @@ export default Component.extend(EventWizardMixin, FormMixin, {
{
type : 'empty',
prompt : this.l10n.t('Please tell us when your event starts')
},
{
type : 'checkStartDateCFS',
prompt : this.l10n.t('CFS start time should be before than event start time')
}
]
},
Expand All @@ -57,6 +69,10 @@ export default Component.extend(EventWizardMixin, FormMixin, {
{
type : 'empty',
prompt : this.l10n.t('Please tell us when your event ends')
},
{
type : 'checkEndDateCFS',
prompt : this.l10n.t('CFS end time should be before than event start time')
}
]
},
Expand Down