Adapt js for homepage calendar