kekeh / angular-mydatepicker

Angular datepicker and date range picker :date:
https://kekeh.github.io/angular-mydatepicker/
MIT License
1 stars 11 forks source link

added the todayBtnTxt back in IMyOptions #7

Closed ghost closed 5 years ago

ghost commented 5 years ago

this.myDatePickerOptions.todayBtnTxt = 'today'; is breaking due to not defined in the type. but I can use this temporarily: this.myDatePickerOptions['todayBtnTxt'] = 'today';

it is better to add the todayBtnTxt back to the type.

codecov-io commented 5 years ago

Codecov Report

Merging #7 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #7   +/-   ##
=======================================
  Coverage   78.88%   78.88%           
=======================================
  Files          16       16           
  Lines         895      895           
  Branches      205      205           
=======================================
  Hits          706      706           
  Misses        189      189

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d5d4318...0a25fc6. Read the comment docs.

kekeh commented 5 years ago

Hi

This component has nothing to do with the todayBtnTxt. You can check it from here: https://github.com/kekeh/angular-mydatepicker/search?q=todayBtnTxt&unscoped_q=todayBtnTxt

You cannot use that option with this datepicker. All options: https://github.com/kekeh/angular-mydatepicker#options-attribute

ghost commented 5 years ago

hi, surprisingly, this.myDatePickerOptions['todayBtnTxt'] = 'today'; is working as expected.

kekeh commented 5 years ago

Your code works, but you don't need to set that option, because that option is not included to angular-mydatepicker component. The todayBtnTxt option is in the mydatepicker component and it is totally different component. So I have removed the todayBtnTxt option from the angular-mydatepicker.

As you can see here https://kekeh.github.io/angular-mydatepicker/ there is no longer today button on calendar.

Today button is only mydatepicker component: http://kekeh.github.io/mydatepicker/

ghost commented 5 years ago

in my component , i have these below code and it is working : import {IAngularMyDpOptions, IMyDateModel} from 'angular-mydatepicker'; myDatePickerOptions: IAngularMyDpOptions = {};
this.myDatePickerOptions['todayBtnTxt'] = '오늘'; // i need to change the default text

I am just wondering how this above could work if todayBtnTxt is not included in angular-mydatepicker component.`

btw. I have both "angular-mydatepicker": "0.0.11", and "ngx-mydatepicker": "^2.4.5", in my package.json.

kekeh commented 5 years ago
// This creates a new property todayBtnTxt to options and it works in your code, but not in angular-datapicker
this.myDatePickerOptions['todayBtnTxt'] = '오늘'; 

// This tries use existing property and it fails because there is not that property
this.myDatePickerOptions.todayBtnTxt = '오늘'; 
kekeh commented 5 years ago

If you use both components in same controller you can define own options to both components.