Port https://github.com/platypus-creation/bootstrap-daterangepicker/commit/303ba7ef8581ec87699e3e978c2b4c4fe6d6e763