telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
468 stars 216 forks source link

Angular 9 - kendo-date-math #2852

Closed kokhooi closed 4 years ago

kokhooi commented 4 years ago

Unable to build in Angular 9 due to error in kendo-date-math component

image

kokhooi commented 4 years ago

These are the packages used

"dependencies": { "@angular/animations": "9.1.2", "@angular/cdk": "9.2.1", "@angular/common": "9.1.2", "@angular/compiler": "9.1.2", "@angular/core": "9.1.2", "@angular/forms": "9.1.2", "@angular/material": "9.2.1", "@angular/platform-browser": "9.1.2", "@angular/platform-browser-dynamic": "9.1.2", "@angular/platform-server": "9.1.2", "@angular/router": "9.1.2", "@aspnet/signalr": "1.1.4", "@progress/kendo-angular-buttons": "5.2.3", "@progress/kendo-angular-charts": "4.1.3", "@progress/kendo-angular-common": "1.2.2", "@progress/kendo-angular-dateinputs": "4.2.1", "@progress/kendo-angular-dialog": "4.1.2", "@progress/kendo-angular-dropdowns": "4.2.4", "@progress/kendo-angular-excel-export": "3.1.2", "@progress/kendo-angular-grid": "4.6.3", "@progress/kendo-angular-inputs": "6.4.2", "@progress/kendo-angular-intl": "2.0.1", "@progress/kendo-angular-l10n": "2.0.1", "@progress/kendo-angular-layout": "4.2.1", "@progress/kendo-angular-pdf-export": "2.0.2", "@progress/kendo-angular-popup": "3.0.5", "@progress/kendo-angular-scrollview": "3.0.1", "@progress/kendo-angular-sortable": "3.0.2", "@progress/kendo-angular-tooltip": "2.1.2", "@progress/kendo-angular-treeview": "4.1.0", "@progress/kendo-data-query": "1.5.2", "@progress/kendo-drawing": "1.6.0", "@progress/kendo-theme-default": "4.12.1", "@types/dragula": "3.7.0", "@types/file-saver": "2.0.1", "@types/googlemaps": "3.39.3", "@types/moment-timezone": "0.5.13", "@types/socket.io-client": "1.4.32", "angular-2-dropdown-multiselect": "1.9.0", "angular-bound-sensor": "1.1.0", "angular-oauth2-oidc": "9.2.0", "angular-tree-component": "8.5.6", "bootstrap-material-design-icons": "2.2.0", "classlist.js": "1.1.20150312", "core-js": "3.6.5", "crypto-js": "4.0.0", "custom-event-polyfill": "1.0.7", "dom-autoscroller": "2.3.4", "file-saver": "2.0.2", "firebase": "7.14.1", "fontawesome-markers": "4.6.1", "hammerjs": "2.0.8", "js2xmlparser": "4.0.1", "jszip": "3.3.0", "mdn-polyfills": "5.20.0", "mobx-angular": "4.1.0", "moment": "2.24.0", "moment-timezone": "0.5.28", "ng-in-viewport": "6.1.0", "ng-pick-datetime": "7.0.0", "ng2-dragula": "2.1.1", "ng2-events": "4.2.2", "ng6-toastr": "6.0.0", "ngx-bootstrap": "5.6.2", "ngx-clipboard": "13.0.0", "ngx-color-picker": "9.1.0", "ngx-contextmenu": "5.4.0", "ngx-pagination": "5.0.0", "rxjs": "6.5.5", "rxjs-compat": "6.5.5", "screenfull": "5.0.2", "setimmediate": "1.0.5", "socket.io-client": "2.3.0", "stream": "0.0.2", "timers": "0.1.1", "tixif-ngx-busy": "0.0.8", "uuid": "7.0.3", "web-animations-js": "2.3.2", "webrtc-adapter": "7.5.1", "xml2js": "0.4.23", "zone.js": "0.10.3" }, "devDependencies": { "@angular-devkit/build-angular": "0.901.1", "@angular-devkit/core": "9.1.1", "@angular/cli": "9.1.1", "@angular/compiler-cli": "9.1.2", "@types/jasmine": "3.5.10", "@types/node": "13.11.1", "codelyzer": "5.2.2", "jasmine": "3.5.0", "jasmine-core": "3.5.0", "jasmine-spec-reporter": "5.0.1", "karma": "5.0.2", "karma-chrome-launcher": "3.1.0", "karma-cli": "2.0.0", "karma-coverage-istanbul-reporter": "2.1.1", "karma-jasmine": "3.1.1", "karma-jasmine-html-reporter": "1.5.3", "karma-trx-reporter": "0.4.3", "protractor": "6.0.0", "puppeteer": "3.0.0", "terser": "4.6.11", "ts-node": "8.8.2", "tslint": "6.1.1", "typescript": "3.8.3", "webpack-bundle-analyzer": "3.7.0" }

Any workaround for this?

kokhooi commented 4 years ago

I extend the Date class internally, hence the error

aswanidutt93 commented 4 years ago

@kokhooi Can you please elaborate your solution a bit. I'm also facing the same issue and struck at it from long time

kokhooi commented 4 years ago

Hi, For eg, I extend the Date to have withoutTime method

interface Date { withoutTime: () => Date; }

Date.prototype.withoutTime = function () { // Implementation }

What I did is to extend the ZonedDate as well declare module '@progress/kendo-date-math/dist/npm/tz/zoned-date' { interface ZonedDate { withoutTime: () => Date; } }

ZonedDate.prototype.withoutTime = function () { // Implementation }

Is this what you are looking for?