libusoftcicom / lc-datepicker Goto Github PK
View Code? Open in Web Editor NEWPure Angular 2+ date and time picker.
License: MIT License
Pure Angular 2+ date and time picker.
License: MIT License
package.json:
"@libusoftcicom/lc-datepicker": "^1.5.2";
"moment": "^2.25.3";
even I used moment 2.24, the same error coming.
Error Log : -
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (81,79): Cannot find name 'T'.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (81,44): ';' expected.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (81,77): Expression expected.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (82,52): ';' expected.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (82,88): ';' expected.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (82,92): Expression expected.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (81,52): 'ObservableInput' only refers to a type, but is being used as a value here.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (81,68): Cannot find name 'infer'.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (81,74): Cannot find name 'T'.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (81,74): ';' expected.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (81,83): Cannot find name 'never'.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (82,66): 'ObservableInput' only refers to a type, but is being used as a value here.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (82,82): Cannot find name 'infer'.
ERROR in systemPathnode_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (82,88): Cannot find name 'T'.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (82,94): Cannot find name 'T'.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/types.d.ts (82,98): Cannot find name 'never'.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/Notification.d.ts (7,12): In ambient enum declarations member initializer must be constant expression.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/Notification.d.ts (8,13): In ambient enum declarations member initializer must be constant expression.
ERROR in systemPath/node_modules/@libusoftcicom/lc-datepicker/node_modules/rxjs/internal/Notification.d.ts (9,16): In ambient enum declarations member initializer must be constant expression.
I'm facing an issue where I have a start date-time and end date-time, where startDate should always be 1 minute less than endDate.
I have written a condition to add disable time range as below:
setEndDateOptions() {
const today = moment().format();
let startDate = this.startDateTime;
this.endDateTimeConfig.MinDate = {
date: moment(today).get('date'),
months: moment(today).get('month'),
years: moment(today).get('year')
};
if (startDate) {
if (startDate.substring(0, 10) === today.substring(0, 10)) {
const minTime = startDate.split('T')[1];
this.endDateTimeConfig.addDisabledTimeRange('00:00', minTime);
}
}
}
So as per above code when startDate and endDate are same and if startDate is selected, disable all the time range from 00:00 till startTime. But if I go back and change the startDate to a previous date still the disabled time range is disabled.
I tried the below code which is throwing error:
// Cannot assign to 'DisabledTimeRanges' because it is a read-only property.
this.endDateTimeConfig.DisabledTimeRanges = [];
Please let me know how I can enable the disabled timerange.
imports: [
BrowserModule,
HttpModule,
...
LcDatePickerModule
],
LcDatePickerModule appears red and cannot be imported
Is there any way if we can disable time in datetime picker, for specific hours
Hi,
When I inserted the tag <lc-datepicker...> in my template, I would have expected an input field with the calendar button which is not the case.
When using your demo project, I just realized that I have to provide everything and interact with the visibility of your component via the property 'opened'.
It is a pain as I would have to create a component on my own that embeds this input field/button to not duplicate the code in every template.
is it possible to add this input field/button like in your demo project?
Thanks,
Serge.
If I created config like
const config: DatePickerConfig = new DatePickerConfig();
config.CalendarType = ECalendarType.Date;
config.MinDate = { years: 1986, months: 1, date: 1 };
config.MaxDate = { years: 1987, months: 12, date: 31 };
it's totally unclear that all years from the 0 (and even -100500th year is still available) and till the 1000000000 are available in the year list. Also, this scroll is too hard for the touchpad on the laptop. Can you show only allowed years in the year list?
It would be nice to be able to have seconds :)
Hi,
You missed the import statement to get the LcDatePickerModule.
Regards,
Serge.
Is it possible to install/build the component for Angular 15?
Hi @mematija ! Nice component!
You can reproduce this behavior right on your demo page https://libusoftcicom.github.io/lc-datepicker/
How to reproduce:
The user's current month, must be a month with less than 31 days. (Now that I'm writing this is April, and April has 30 days)
If you select the date March 31st in the picker, the date the component selects (and returns) is March 1st.
How to fix:
In lc-datepicker.es5.js : function LCDayPickerComponent.prototype.dayClick
Swap the two lines
date.date(item.date);
date.month(item.months);
to be like this:
date.month(item.months);
date.date(item.date);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.