├── .angular-cli.json ├── .editorconfig ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README.fa.md ├── README.md ├── build-helpers └── index-maker.js ├── build.js ├── e2e ├── app.e2e-spec.ts ├── app.po.ts ├── configuration-e2e.spec.ts ├── current-btn-e2e.spec.ts ├── datpicker-e2e.spec.ts ├── daypicker-e2e.spec.ts ├── daytimepicker-e2e.spec.ts ├── directive-e2e.spec.ts ├── format-validation-e2e.spec.ts ├── hide-input-container-e2e.spec.ts ├── locale-e2e.spec.ts ├── move-to-date-api-e2e.spec.ts ├── reactive-directive-e2e.spec.ts ├── selected-unselect-e2e.spec.ts ├── test-utils.ts ├── timepicker-e2e.spec.ts └── tsconfig.e2e.json ├── index.d.ts ├── karma.conf.js ├── npm-shrinkwrap.json ├── package.json ├── protractor.conf.js ├── screenshots ├── date_picker.png ├── date_time_picker.png └── month_picker.png ├── src ├── app │ ├── calendar-nav │ │ ├── calendar-nav.component.html │ │ ├── calendar-nav.component.less │ │ ├── calendar-nav.component.spec.ts │ │ └── calendar-nav.component.ts │ ├── common │ │ ├── decorators │ │ │ └── decorators.ts │ │ ├── models │ │ │ ├── calendar.model.ts │ │ │ ├── date.model.ts │ │ │ └── navigation-event.model.ts │ │ ├── services │ │ │ ├── dom-appender │ │ │ │ └── dom-appender.service.ts │ │ │ └── utils │ │ │ │ ├── utils.service.spec.ts │ │ │ │ └── utils.service.ts │ │ ├── styles │ │ │ └── variables.less │ │ └── types │ │ │ ├── calendar-mode-enum.ts │ │ │ ├── calendar-mode.ts │ │ │ ├── calendar-value-enum.ts │ │ │ ├── calendar-value.ts │ │ │ ├── poistions.type.ts │ │ │ ├── single-calendar-value.ts │ │ │ ├── validator.type.ts │ │ │ └── week-days.type.ts │ ├── date-picker.module.ts │ ├── date-picker │ │ ├── date-picker-config.model.ts │ │ ├── date-picker-directive-config.model.ts │ │ ├── date-picker-directive.service.spec.ts │ │ ├── date-picker-directive.service.ts │ │ ├── date-picker.api.ts │ │ ├── date-picker.component.html │ │ ├── date-picker.component.less │ │ ├── date-picker.component.spec.ts │ │ ├── date-picker.component.ts │ │ ├── date-picker.directive.spec.ts │ │ ├── date-picker.directive.ts │ │ ├── date-picker.service.spec.ts │ │ └── date-picker.service.ts │ ├── day-calendar │ │ ├── day-calendar-config.model.ts │ │ ├── day-calendar.component.html │ │ ├── day-calendar.component.less │ │ ├── day-calendar.component.spec.ts │ │ ├── day-calendar.component.ts │ │ ├── day-calendar.service.spec.ts │ │ ├── day-calendar.service.ts │ │ └── day.model.ts │ ├── day-time-calendar │ │ ├── day-time-calendar-config.model.ts │ │ ├── day-time-calendar.component.html │ │ ├── day-time-calendar.component.less │ │ ├── day-time-calendar.component.spec.ts │ │ ├── day-time-calendar.component.ts │ │ ├── day-time-calendar.service.spec.ts │ │ └── day-time-calendar.service.ts │ ├── demo │ │ ├── demo-root.component.ts │ │ ├── demo.module.ts │ │ ├── demo │ │ │ ├── demo.component.html │ │ │ ├── demo.component.less │ │ │ ├── demo.component.spec.ts │ │ │ └── demo.component.ts │ │ └── services │ │ │ └── ga │ │ │ ├── ga.service.spec.ts │ │ │ └── ga.service.ts │ ├── index.ts │ ├── month-calendar │ │ ├── month-calendar-config.ts │ │ ├── month-calendar.component.html │ │ ├── month-calendar.component.less │ │ ├── month-calendar.component.spec.ts │ │ ├── month-calendar.component.ts │ │ ├── month-calendar.service.spec.ts │ │ ├── month-calendar.service.ts │ │ └── month.model.ts │ └── time-select │ │ ├── time-select-config.model.ts │ │ ├── time-select.component.html │ │ ├── time-select.component.less │ │ ├── time-select.component.spec.ts │ │ ├── time-select.component.ts │ │ ├── time-select.service.spec.ts │ │ └── time-select.service.ts ├── assets │ └── .gitkeep ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.less ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── typings.d.ts ├── tsconfig.json └── tslint.json /.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "ng2-date-picker" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "dist", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "dp", 21 | "styles": [ 22 | "styles.less" 23 | ], 24 | "scripts": [], 25 | "environmentSource": "environments/environment.ts", 26 | "environments": { 27 | "dev": "environments/environment.ts", 28 | "prod": "environments/environment.prod.ts" 29 | } 30 | } 31 | ], 32 | "e2e": { 33 | "protractor": { 34 | "config": "./protractor.conf.js" 35 | } 36 | }, 37 | "lint": [ 38 | { 39 | "project": "src/tsconfig.app.json" 40 | }, 41 | { 42 | "project": "src/tsconfig.spec.json" 43 | }, 44 | { 45 | "project": "e2e/tsconfig.e2e.json" 46 | } 47 | ], 48 | "test": { 49 | "karma": { 50 | "config": "./karma.conf.js" 51 | } 52 | }, 53 | "defaults": { 54 | "styleExt": "less", 55 | "component": {} 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /tmp 5 | /bin 6 | /prebuild 7 | /aot 8 | 9 | # dependencies 10 | /node_modules 11 | /bower_components 12 | 13 | # IDEs and editors 14 | /.idea 15 | /.vscode 16 | .project 17 | .classpath 18 | *.launch 19 | .settings/ 20 | 21 | # misc 22 | /.sass-cache 23 | /connect.lock 24 | /coverage/* 25 | /libpeerconnection.log 26 | npm-debug.log 27 | testem.log 28 | /typings 29 | 30 | # e2e 31 | /e2e/*.js 32 | /e2e/*.map 33 | 34 | #System Files 35 | .DS_Store 36 | Thumbs.db 37 | 38 | dist 39 | src/**/*.js 40 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | language: node_js 4 | node_js: 5 | - '12.18.3' 6 | 7 | cache: 8 | directories: 9 | - node_modules 10 | 11 | addons: 12 | apt: 13 | sources: 14 | - google-chrome 15 | packages: 16 | - google-chrome-stable 17 | 18 | before_install: 19 | - export CHROME_BIN=/usr/bin/google-chrome 20 | - export CHROME_BIN=chromium-browser 21 | - export DISPLAY=:99.0 22 | - sh -e /etc/init.d/xvfb start 23 | - sudo apt-get update 24 | - sudo apt-get install -y libappindicator1 fonts-liberation 25 | - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 26 | - sudo dpkg -i google-chrome*.deb 27 | - sleep 3 28 | - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16" 29 | 30 | before_script: 31 | - npm run lint 32 | - npm test -- -watch=false 33 | #- npm run e2e:headless 34 | 35 | script: 36 | - npm run build:prod 37 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | 5 | # [2.8.1] (2018-03-13) 6 | ### Bug Fixes 7 | - Resolving moment value in Reactive form ([6055041](https://github.com/vlio20/angular-datepicker/commit/6055041)) closes [#371](https://github.com/vlio20/angular-datepicker/issues/371) 8 | 9 | 10 | # [2.8.0] (2018-03-07) 11 | ### Features 12 | - Add `data-date` attribute to each date button ([052b6a8d](https://github.com/vlio20/angular-datepicker/commit/052b6a8d)) closes [#367](https://github.com/vlio20/angular-datepicker/issues/367) 13 | - Show/Hide the picker popup after click outside of the component `hideOnOutsideClick` ([362](https://github.com/vlio20/angular-datepicker/commit/362)) closes [#362](https://github.com/vlio20/angular-datepicker/issues/362) 14 | 15 | 16 | # [2.7.5] (2018-03-05) 17 | ### Bug Fixes 18 | - Adding documentation for `showGoToCurrent` ([b3e3728](https://github.com/vlio20/angular-datepicker/commit/b3e3728)) closes [#357](https://github.com/vlio20/angular-datepicker/issues/357) 19 | - Fixing `inputElementContainer` which did not work on directive + added to docs ([6344b38](https://github.com/vlio20/angular-datepicker/commit/6344b38)) closes [#359](https://github.com/vlio20/angular-datepicker/issues/359) 20 | - Fixing Not able to bind to moment, getting TypeError: `(value || "").split is not a function` ([19cee2d](https://github.com/vlio20/angular-datepicker/commit/19cee2d)) closes [#355](https://github.com/vlio20/angular-datepicker/issues/355) 21 | 22 | 23 | # [2.7.4] (2018-01-13) 24 | - Fixing disabled dates when selecting past/future time from current day ([18db1ca](https://github.com/vlio20/angular-datepicker/commit/18db1ca)) closes [#340](https://github.com/vlio20/angular-datepicker/issues/340) 25 | 26 | ### Features 27 | - Navigation events are now dispatched from all relevant components ([2552889](https://github.com/vlio20/angular-datepicker/commit/2552889)) closes [#329](https://github.com/vlio20/angular-datepicker/issues/329) 28 | - `moveCalendarTo` was added to all components api ([349d48c](https://github.com/vlio20/angular-datepicker/commit/349d48c)) closes [#306](https://github.com/vlio20/angular-datepicker/issues/306) 29 | - `goToCurrent` event was added when go to current button is clicked ([c39080e](https://github.com/vlio20/angular-datepicker/commit/c39080e)) closes [#328](https://github.com/vlio20/angular-datepicker/issues/328) - PR by [@justtal](https://github.com/justtal) 30 | - `unSelectOnClick` was added, this will disable/enable unselection of already selected date ([45e15ac](https://github.com/vlio20/angular-datepicker/commit/45e15ac)) closes [#298](https://github.com/vlio20/angular-datepicker/issues/298) 31 | 32 | ### Improvements 33 | - Change `changeDetectionStrategy` to `onPush` ([a592932](https://github.com/vlio20/angular-datepicker/commit/a592932), [728b342](https://github.com/vlio20/angular-datepicker/commit/728b342), [2fb7073](https://github.com/vlio20/angular-datepicker/commit/2fb7073)) closes [#325](https://github.com/vlio20/angular-datepicker/issues/325) 34 | - Upgrade to Angular 5 ([5abdae1](https://github.com/vlio20/angular-datepicker/commit/5abdae1)) closes [#315](https://github.com/vlio20/angular-datepicker/issues/315) 35 | - Upgrade angular-cli ([5abdae1](https://github.com/vlio20/angular-datepicker/commit/5abdae1)) 36 | 37 | ### Bug Fixes 38 | - Updating docs for showing day-calendar api ([c5533de](https://github.com/vlio20/angular-datepicker/commit/c5533de)) closes [#312](https://github.com/vlio20/angular-datepicker/issues/312) 39 | - Prevent overriding of form control value from input updates ([c96f2](https://github.com/vlio20/angular-datepicker/commit/c96f2)) closes [#297](https://github.com/vlio20/angular-datepicker/issues/297) - PR by [@pklein](https://github.com/pklein) 40 | 41 | ### Breaking Changes 42 | - Multiselect delimiter changed to `|` instead of `,` ([8932f52](https://github.com/vlio20/angular-datepicker/commit/8932f52)) 43 | 44 | 45 | # [2.6.2] (2017-11-11) 46 | 47 | ### Improvements 48 | - Removing document HostListeners to improve performance ([6324364](https://github.com/vlio20/angular-datepicker/commit/6324364)) closes [#292](https://github.com/vlio20/angular-datepicker/issues/292) - PR by [@mrenou](https://github.com/mrenou) 49 | 50 | 51 | # [2.6.1] (2017-11-03) 52 | 53 | ### Bug Fixes 54 | - Hidden attribute not working on IE10 ([e4de3cb ](https://github.com/vlio20/angular-datepicker/commit/e4de3cb)) closes [#283](https://github.com/vlio20/angular-datepicker/issues/283) - PR by [@mrenou](https://github.com/mrenou) 55 | - Browser translate causes interpolates values to NOT update ([8f6d69e](https://github.com/vlio20/angular-datepicker/commit/8f6d69e)) closes [#277](https://github.com/vlio20/angular-datepicker/issues/277) - PR by [@chrxs](https://github.com/chrxs) 56 | - Clearing the input will remove the selected date ([5bfe724](https://github.com/vlio20/angular-datepicker/commit/5bfe724)) closes [#278](https://github.com/vlio20/angular-datepicker/issues/278) 57 | - Set `min` property dynamically ([969eb01](https://github.com/vlio20/angular-datepicker/commit/969eb01)) closes [#269](https://github.com/vlio20/angular-datepicker/issues/269) 58 | - `disableKeypress` does not work on the directive ([1c00e48](https://github.com/vlio20/angular-datepicker/commit/1c00e48)) closes [#267](https://github.com/vlio20/angular-datepicker/issues/267) 59 | - Go to current button not centered ([9b6dc99](https://github.com/vlio20/angular-datepicker/commit/9b6dc99)) closes [#275](https://github.com/vlio20/angular-datepicker/issues/275) - PR by [@KevinJannis](https://github.com/KevinJannis) 60 | 61 | 62 | # [2.6.0] (2017-10-22) 63 | 64 | ### Features 65 | - Moving go to current button inside the navigation component, enables go to current in inline components ([dd283c5](https://github.com/vlio20/angular-datepicker/commit/dd283c5)). 66 | 67 | ### UI/UX Changes 68 | - Moving go to current button inside the navigation component ([dd283c5](https://github.com/vlio20/angular-datepicker/commit/dd283c5)). 69 | 70 | ### Improvements 71 | - Min date as default when calendar opens ([5663b7a](https://github.com/vlio20/angular-datepicker/commit/5663b7a)) closes [#256](https://github.com/vlio20/angular-datepicker/issues/256) 72 | - Stop using getters in template ([3858dde](https://github.com/vlio20/angular-datepicker/commit/3858dde)) closes [#239](https://github.com/vlio20/angular-datepicker/issues/239) 73 | 74 | ### Bug Fixes 75 | - Fix for `ngOnDestroy` throws error when in SSR ([c2a0c8b](https://github.com/vlio20/angular-datepicker/commit/c2a0c8b)) closes [#163](https://github.com/vlio20/angular-datepicker/issues/163) 76 | - `displayDate` on the directive bug fix ([984aab8](https://github.com/vlio20/angular-datepicker/commit/984aab8)) closes [#254](https://github.com/vlio20/angular-datepicker/issues/254) 77 | - `max`/`min` date support for strings ([ad98d1b](https://github.com/vlio20/angular-datepicker/commit/ad98d1b)) closes [#250](https://github.com/vlio20/angular-datepicker/issues/250) 78 | - `value.split` is not a function bug fix ([38f6ce2](https://github.com/vlio20/angular-datepicker/commit/38f6ce2)) closes [#225](https://github.com/vlio20/angular-datepicker/issues/245) 79 | - Add outputs of each component to docs ([9ee8035](https://github.com/vlio20/angular-datepicker/commit/9ee8035)) closes [#224](https://github.com/vlio20/angular-datepicker/issues/224) 80 | - More than one picker can be opened at the same time ([dd283c5](https://github.com/vlio20/angular-datepicker/commit/dd283c5)) closes [#223](https://github.com/vlio20/angular-datepicker/issues/223) 81 | - Picker not always opens according to drops/opens ([c26d168](https://github.com/vlio20/angular-datepicker/commit/c26d168)) closes [#222](https://github.com/vlio20/angular-datepicker/issues/222) 82 | 83 | ### Breaking Changes 84 | - Go to current button moved from input element to the navigation component ([dd283c5](https://github.com/vlio20/angular-datepicker/commit/dd283c5)). 85 | - Default locale is now set with [`moment.locale()`](https://momentjs.com/docs/#/i18n/getting-locale/) instead of hard coded `en` 86 | 87 | 88 | 89 | 90 | # [2.5.1](https://github.com/vlio20/angular-datepicker/releases/tag/2.5.1) (2017-10-12) 91 | 92 | ### Bug Fixes 93 | - 29th October 2017 displayed twice [#235](https://github.com/vlio20/angular-datepicker/issues/235#issuecomment-336217634) 94 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribute 2 | 3 | ## Introduction 4 | 5 | First, thank you for considering contributing to angular-datepicker! It's people like you that make the open source community such a great community! 😊 6 | 7 | We welcome any type of contribution, not only code. You can help with 8 | - **QA**: file bug reports, the more details you can give the better (e.g. screenshots with the console open) 9 | - **Marketing**: writing blog posts, howto's, printing stickers, ... 10 | - **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ... 11 | - **Code**: take a look at the [open issues](issues). Even if you can't write code, commenting on them, showing that you care about a given issue matters. It helps us triage them. 12 | - **Money**: we welcome financial contributions in full transparency on our [open collective](https://opencollective.com/angular-datepicker). 13 | 14 | ## Your First Contribution 15 | 16 | Working on your first Pull Request? You can learn how from this *free* series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). 17 | 18 | ## Submitting code 19 | 20 | Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it. The pull request should also contain tests. 21 | 22 | ## Code review process 23 | 24 | The bigger the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge. 25 | It is also always helpful to have some context for your pull request. What was the purpose? Why does it matter to you? 26 | 27 | ## Financial contributions 28 | 29 | We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/angular-datepicker). 30 | Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. 31 | 32 | ## Questions 33 | 34 | If you have any questions, create an [issue](issue) (protip: do a quick search first to see if someone else didn't ask the same question before!). 35 | You can also reach us at hello@angular-datepicker.opencollective.com. 36 | 37 | ## Credits 38 | 39 | ### Contributors 40 | 41 | Thank you to all the people who have already contributed to angular-datepicker! 42 | 43 | 44 | 45 | ### Backers 46 | 47 | Thank you to all our backers! [[Become a backer](https://opencollective.com/angular-datepicker#backer)] 48 | 49 | 50 | 51 | 52 | ### Sponsors 53 | 54 | Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/angular-datepicker#sponsor)) 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Make sure to add **all the information needed to understand the bug** so that someone can help. If the info is missing we'll add the 'Needs more information' label and close the issue until there is enough information. 2 | 3 | - [ ] Provide a **minimal code snippet**, please make sure it is well formatted. 4 | - [ ] Provide a **stackblitz** demo / [stackblitz](https://stackblitz.com/) example that reproduces the bug. 5 | - [ ] Provide **screenshots** where appropriate 6 | - [ ] What's the **version** of Angular you're using? 7 | - [ ] Does this occur on specific browser? 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Vlad Ioffe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.fa.md: -------------------------------------------------------------------------------- 1 | # Angular Jalali Date Picker 2 | انتخاب گر تاریخ شمسی در انگولار ۴ 3 | [دمو](https://fingerpich.github.io/jalali-angular-datepicker/) 4 | 5 | [![Build Status](https://travis-ci.org/fingerpich/jalali-angular-datepicker.svg?branch=jalali-master)](https://travis-ci.org/fingerpich/jalali-angular-datepicker) 6 | [![npm version](https://badge.fury.io/js/ng2-jalali-date-picker.svg)](https://badge.fury.io/js/ng2-jalali-date-picker) 7 | [![Package Quality](http://npm.packagequality.com/shield/ng2-jalali-date-picker.svg)](http://packagequality.com/#?package=ng2-jalali-date-picker) 8 | [![dependency Quality](https://david-dm.org/fingerpich/jalali-angular-datepicker.svg)](https://david-dm.org/fingerpich/jalali-angular-datepicker) 9 | [![dev dependency Quality](https://david-dm.org/fingerpich/jalali-angular-datepicker/dev-status.svg)](https://david-dm.org/fingerpich/jalali-angular-datepicker?type=dev) 10 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/72a073fa893f4f0b823f41106c9e4f56)](https://www.codacy.com/app/zarei-bs/jalali-angular-datepicker?utm_source=github.com&utm_medium=referral&utm_content=fingerpich/jalali-angular-datepicker&utm_campaign=Badge_Grade) 11 | [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/72a073fa893f4f0b823f41106c9e4f56)](https://www.codacy.com/app/zarei-bs/jalali-angular-datepicker?utm_source=github.com&utm_medium=referral&utm_content=fingerpich/jalali-angular-datepicker&utm_campaign=Badge_Coverage) 12 | 13 | ## تصاویر 14 | 15 | date pickerdate time pickermonth picker 16 | 17 | ## فهرست مطالب : 18 | 19 | − [نصب کتابخانه](https://github.com/fingerpich/jalali-angular-datepicker#installation) 20 | - [نحوه استفاده از انتخابگر تاریخ شمسی](https://github.com/fingerpich/jalali-angular-datepicker#how_to_use) 21 | - [نمایش تاریخ انتخاب شده به صورت های مختلف در تاریخ خورشیدی](https://github.com/fingerpich/jalali-angular-datepicker#how_to_use_the_output_as_a_jalali_shamsi_date) 22 | - [استفاده یا تغییر صفات انتخابگر تاریخ جلالی](https://github.com/fingerpich/jalali-angular-datepicker#Attributes) 23 | - [تنظمات انتخابگر تاریخ فارسی](https://github.com/fingerpich/jalali-angular-datepicker#Configuration) 24 | - [نحوه استفاده از انتخاب گر در داخل کلاس ها](https://github.com/fingerpich/jalali-angular-datepicker#API) 25 | - [نحوه استفاده از انتخابگر به صورت همیشه ظاهر](https://github.com/fingerpich/jalali-angular-datepicker#Inline_-_Day_Calendar) 26 | - [نحوه استفاده از انتخابگر مستقل از المنت ورودی](https://github.com/fingerpich/jalali-angular-datepicker#Directive) 27 | -------------------------------------------------------------------------------- /build-helpers/index-maker.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | const indexPath = path.resolve('../dist/index.html'); 5 | 6 | fs.readFile(indexPath, 'utf8', (err, data) => { 7 | if (err) { 8 | return console.log(err); 9 | } 10 | 11 | const result = data.replace(` 18 | 19 | Loading... 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 3 | import {enableProdMode} from '@angular/core'; 4 | import {environment} from './environments/environment'; 5 | import {DemoModule} from './app/demo/demo.module'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(DemoModule); 12 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | /*************************************************************************************************** 17 | * BROWSER POLYFILLS 18 | */ 19 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 20 | import 'core-js/es6/symbol'; 21 | import 'core-js/es6/object'; 22 | import 'core-js/es6/function'; 23 | import 'core-js/es6/parse-int'; 24 | import 'core-js/es6/parse-float'; 25 | import 'core-js/es6/number'; 26 | import 'core-js/es6/math'; 27 | import 'core-js/es6/string'; 28 | import 'core-js/es6/date'; 29 | import 'core-js/es6/array'; 30 | import 'core-js/es6/regexp'; 31 | import 'core-js/es6/map'; 32 | import 'core-js/es6/set'; 33 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 34 | import 'classlist.js'; // Run `npm install --save classlist.js`. 35 | /** IE10 and IE11 requires the following to support `@angular/animation`. */ 36 | import 'web-animations-js'; // Run `npm install --save web-animations-js`. 37 | /** Evergreen browsers require these. **/ 38 | import 'core-js/es6/reflect'; 39 | import 'core-js/es7/reflect'; 40 | /** ALL Firefox browsers require the following to support `@angular/animation`. **/ 41 | import 'web-animations-js'; // Run `npm install --save web-animations-js`. 42 | /*************************************************************************************************** 43 | * Zone JS is required by Angular itself. 44 | */ 45 | import 'zone.js/dist/zone'; // Included with Angular CLI. 46 | 47 | /*************************************************************************************************** 48 | * APPLICATION IMPORTS 49 | */ 50 | 51 | /** 52 | * Date, currency, decimal and percent pipes. 53 | * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 54 | */ 55 | // import 'intl'; // Run `npm install --save intl`. 56 | -------------------------------------------------------------------------------- /src/styles.less: -------------------------------------------------------------------------------- 1 | & { 2 | html, body { 3 | margin: 0; 4 | padding: 0; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import {getTestBed} from '@angular/core/testing'; 10 | import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing'; 11 | 12 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 13 | declare var __karma__: any; 14 | declare var require: any; 15 | 16 | // Prevent Karma from running prematurely. 17 | __karma__.loaded = function () { 18 | }; 19 | 20 | // First, initialize the Angular testing environment. 21 | getTestBed().initTestEnvironment( 22 | BrowserDynamicTestingModule, 23 | platformBrowserDynamicTesting() 24 | ); 25 | // Then we find all the tests. 26 | const context = require.context('./', true, /\.spec\.ts$/); 27 | // And load the modules. 28 | context.keys().map(context); 29 | // Finally, start Karma to run the tests. 30 | __karma__.start(); 31 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "declaration": false, 5 | "moduleResolution": "node", 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "lib": [ 9 | "es2016", 10 | "dom" 11 | ], 12 | "outDir": "../out-tsc/app", 13 | "target": "es5", 14 | "module": "es2015", 15 | "baseUrl": "", 16 | "types": [] 17 | }, 18 | "exclude": [ 19 | "test.ts", 20 | "**/*.spec.ts" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": true, 4 | "declaration": false, 5 | "moduleResolution": "node", 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "lib": [ 9 | "es2016", 10 | "dom" 11 | ], 12 | "outDir": "../out-tsc/spec", 13 | "module": "commonjs", 14 | "target": "es6", 15 | "baseUrl": "", 16 | "types": [ 17 | "jasmine", 18 | "node", 19 | "jalali-moment" 20 | ] 21 | }, 22 | "files": [ 23 | "test.ts" 24 | ], 25 | "include": [ 26 | "**/*.spec.ts" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: { 3 | id: string; 4 | }; 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "outDir": "bin", 5 | "sourceMap": true, 6 | "declaration": true, 7 | "moduleResolution": "node", 8 | "experimentalDecorators": true, 9 | "emitDecoratorMetadata": true, 10 | "skipLibCheck": true, 11 | "types": [ 12 | "node", 13 | "jasmine" 14 | ], 15 | "lib": [ 16 | "es2015", 17 | "dom" 18 | ] 19 | }, 20 | "exclude": [ 21 | "node_modules", 22 | "**/*.spec.ts" 23 | ], 24 | "angularCompilerOptions": { 25 | "genDir": "aot", 26 | "debug": true, 27 | "skipTemplateCodegen": true, 28 | "strictMetadataEmit": true 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "callable-types": true, 7 | "class-name": true, 8 | "comment-format": [ 9 | true, 10 | "check-space" 11 | ], 12 | "curly": true, 13 | "eofline": false, 14 | "forin": true, 15 | "import-blacklist": [ 16 | true, 17 | "rxjs" 18 | ], 19 | "import-spacing": true, 20 | "indent": [ 21 | true, 22 | "spaces" 23 | ], 24 | "interface-over-type-literal": true, 25 | "label-position": true, 26 | "max-line-length": [ 27 | true, 28 | 140 29 | ], 30 | "trailing-comma": [ 31 | true, 32 | { 33 | "multiline": "never", 34 | "singleline": "never" 35 | } 36 | ], 37 | "member-access": false, 38 | "member-ordering": [ 39 | true, 40 | "static-before-instance", 41 | "variables-before-functions" 42 | ], 43 | "no-arg": true, 44 | "no-bitwise": true, 45 | "no-console": [ 46 | true, 47 | "debug", 48 | "info", 49 | "time", 50 | "timeEnd", 51 | "trace" 52 | ], 53 | "no-construct": true, 54 | "no-debugger": true, 55 | "no-duplicate-variable": true, 56 | "no-empty": false, 57 | "no-empty-interface": true, 58 | "no-eval": true, 59 | "no-inferrable-types": [ 60 | false, 61 | "ignore-params" 62 | ], 63 | "no-shadowed-variable": true, 64 | "no-string-literal": false, 65 | "no-string-throw": true, 66 | "no-switch-case-fall-through": true, 67 | "no-trailing-whitespace": true, 68 | "no-unused-expression": true, 69 | "no-use-before-declare": true, 70 | "no-var-keyword": true, 71 | "object-literal-sort-keys": false, 72 | "one-line": [ 73 | true, 74 | "check-open-brace", 75 | "check-catch", 76 | "check-else", 77 | "check-whitespace" 78 | ], 79 | "prefer-const": true, 80 | "quotemark": [ 81 | true, 82 | "single" 83 | ], 84 | "radix": true, 85 | "semicolon": [ 86 | "always" 87 | ], 88 | "triple-equals": [ 89 | true, 90 | "allow-null-check" 91 | ], 92 | "typedef-whitespace": [ 93 | true, 94 | { 95 | "call-signature": "nospace", 96 | "index-signature": "nospace", 97 | "parameter": "nospace", 98 | "property-declaration": "nospace", 99 | "variable-declaration": "nospace" 100 | } 101 | ], 102 | "typeof-compare": true, 103 | "unified-signatures": true, 104 | "variable-name": false, 105 | "whitespace": [ 106 | true, 107 | "check-branch", 108 | "check-decl", 109 | "check-operator", 110 | "check-separator", 111 | "check-type" 112 | ], 113 | "directive-selector": [ 114 | true, 115 | "attribute", 116 | "dp", 117 | "camelCase" 118 | ], 119 | "component-selector": [ 120 | true, 121 | "element", 122 | "dp", 123 | "kebab-case" 124 | ], 125 | "use-input-property-decorator": true, 126 | "use-output-property-decorator": true, 127 | "use-host-property-decorator": true, 128 | "no-input-rename": false, 129 | "no-output-rename": true, 130 | "use-life-cycle-interface": true, 131 | "use-pipe-transform-interface": true, 132 | "component-class-suffix": true, 133 | "directive-class-suffix": true, 134 | "no-access-missing-member": true, 135 | "templates-use-public": true, 136 | "invoke-injectable": true 137 | } 138 | } 139 | --------------------------------------------------------------------------------