On weighted residual and past entropies