commit
27e7674183
|
@ -19,3 +19,4 @@ FROM nginx:alpine as serve-stage
|
|||
# Copy assets & config
|
||||
COPY --from=build-stage /app/www /usr/share/nginx/html
|
||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||
HEALTHCHECK --interval=10s --timeout=4s CMD curl -f http://localhost/assets/env.json || exit 1
|
||||
|
|
|
@ -450,8 +450,8 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave {
|
|||
async submit(): Promise<void> {
|
||||
// Validate data.
|
||||
const formData = this.form.value;
|
||||
const timeStartDate = CoreTimeUtils.convertToTimestamp(formData.timestart);
|
||||
const timeUntilDate = CoreTimeUtils.convertToTimestamp(formData.timedurationuntil);
|
||||
const timeStartDate = CoreTimeUtils.convertToTimestamp(formData.timestart, true);
|
||||
const timeUntilDate = CoreTimeUtils.convertToTimestamp(formData.timedurationuntil, true);
|
||||
const timeDurationMinutes = parseInt(formData.timedurationminutes || '', 10);
|
||||
let error: string | undefined;
|
||||
|
||||
|
|
|
@ -498,9 +498,11 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp
|
|||
};
|
||||
|
||||
// Try to find page number and offset of the entry.
|
||||
const pageXOffset = this.entries.findIndex((entry) => entry.id == entryId);
|
||||
if (pageXOffset >= 0) {
|
||||
params.offset = this.search.page * AddonModDataProvider.PER_PAGE + pageXOffset;
|
||||
if (!this.search.searching) {
|
||||
const pageXOffset = this.entries.findIndex((entry) => entry.id == entryId);
|
||||
if (pageXOffset >= 0) {
|
||||
params.offset = this.search.page * AddonModDataProvider.PER_PAGE + pageXOffset;
|
||||
}
|
||||
}
|
||||
|
||||
CoreNavigator.navigateToSitePath(
|
||||
|
|
|
@ -328,15 +328,23 @@ export class CoreTimeUtilsProvider {
|
|||
/**
|
||||
* Convert a text into user timezone timestamp.
|
||||
*
|
||||
* @todo The `applyOffset` argument is only used as a workaround, it should be removed once
|
||||
* MOBILE-3784 is resolved.
|
||||
*
|
||||
* @param date To convert to timestamp.
|
||||
* @param applyOffset Whether to apply offset to date or not.
|
||||
* @return Converted timestamp.
|
||||
*/
|
||||
convertToTimestamp(date: string): number {
|
||||
if (typeof date == 'string' && date.slice(-1) == 'Z') {
|
||||
return moment(date).unix() - (moment().utcOffset() * 60);
|
||||
convertToTimestamp(date: string, applyOffset?: boolean): number {
|
||||
const timestamp = moment(date).unix();
|
||||
|
||||
if (typeof applyOffset !== 'undefined') {
|
||||
return applyOffset ? timestamp - moment().utcOffset() * 60 : timestamp;
|
||||
}
|
||||
|
||||
return moment(date).unix();
|
||||
return typeof date == 'string' && date.slice(-1) == 'Z'
|
||||
? timestamp - moment().utcOffset() * 60
|
||||
: timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue