Нет описания

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*!
  2. FullCalendar Moment Timezone Plugin v4.3.0
  3. Docs & License: https://fullcalendar.io/
  4. (c) 2019 Adam Shaw
  5. */
  6. import * as momentNs from 'moment';
  7. import 'moment-timezone/builds/moment-timezone-with-data';
  8. import { createPlugin, NamedTimeZoneImpl } from '@fullcalendar/core';
  9. /*! *****************************************************************************
  10. Copyright (c) Microsoft Corporation. All rights reserved.
  11. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  12. this file except in compliance with the License. You may obtain a copy of the
  13. License at http://www.apache.org/licenses/LICENSE-2.0
  14. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  16. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17. MERCHANTABLITY OR NON-INFRINGEMENT.
  18. See the Apache Version 2.0 License for specific language governing permissions
  19. and limitations under the License.
  20. ***************************************************************************** */
  21. /* global Reflect, Promise */
  22. var extendStatics = function(d, b) {
  23. extendStatics = Object.setPrototypeOf ||
  24. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  25. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  26. return extendStatics(d, b);
  27. };
  28. function __extends(d, b) {
  29. extendStatics(d, b);
  30. function __() { this.constructor = d; }
  31. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  32. }
  33. var moment = momentNs; // the directly callable function
  34. var MomentNamedTimeZone = /** @class */ (function (_super) {
  35. __extends(MomentNamedTimeZone, _super);
  36. function MomentNamedTimeZone() {
  37. return _super !== null && _super.apply(this, arguments) || this;
  38. }
  39. MomentNamedTimeZone.prototype.offsetForArray = function (a) {
  40. return moment.tz(a, this.timeZoneName).utcOffset();
  41. };
  42. MomentNamedTimeZone.prototype.timestampToArray = function (ms) {
  43. return moment.tz(ms, this.timeZoneName).toArray();
  44. };
  45. return MomentNamedTimeZone;
  46. }(NamedTimeZoneImpl));
  47. var main = createPlugin({
  48. namedTimeZonedImpl: MomentNamedTimeZone
  49. });
  50. export default main;