Handsontable with datetimepicker - datetimepicker

Is there a plugin to implement datetimepicker in handsontable? The closest I got was pickadate fork here but I have no clue how to implement this in Handsontable.

You can achieve this by modifying the file handsontable.full.js.
Take this file: http://handsontable.com/dist/handsontable.full.js
Find the section "Pikaday":
/*!
* Pikaday
*
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
*/
(function (root, factory)
{
.......
return Pikaday;
}));
Replace it with this fork: https://github.com/owenmead/Pikaday/blob/master/pikaday.js
Then specify the date format like: dateFormat: "YYYY-MM-DD HH:mm".

There are plenty of ways to customize existing date editors for HT.
But sad thing pikaday.js doesn't support time selection (check section time picker https://github.com/Pikaday/Pikaday). You have to create custom dp for HT.
https://handsontable.com/docs/8.1.0/tutorial-cell-editor.html
Take a look at
class CalendarEditor extends TextEditor
Or you can extend from
Handsontable.editors.DateEditor
Choose any date picker with time picker.

Related

Expo Calendar - Using the recurrenceRule for createEventAsync()

I'm struggling with some of the formatting for parameters inside the recurrenceRule when trying to create a new event with Expo Calendar. I can't seem to find any robust recurrence examples in the docs or anywhere else for that matter. One specific thing I'm struggling is daysOfTheWeek, where I'm trying to pass multiple days but I'm not even sure if you can.
Does anyone have a good working example of the recurrenceRule in action?
After struggling with this myself I found that if you look up types in your Calendar.d.ts file it should give you the required structure of the recurrenceRule.
export declare type RecurrenceRule = {
frequency: string
interval?: number // #default 1
endDate?: string | Date
occurrence?: number
daysOfTheWeek?: DaysOfTheWeek[]
daysOfTheMonth?: number[]
monthsOfTheYear?: MonthOfTheYear[]
weeksOfTheYear?: number[]
daysOfTheYear?: number[]
setPositions?: number[]
};
So if your use case is like mine and you just want the event to occur only once something like this will work: recurrenceRule: {frequency: 'DAILY', occurrence: 1} I think. Expo-documentation says recurrence rule can be set to null, but this throws an error. Hope this helps!

Why are the minutes disabled in vue-ctk-date-time-picker?

I am using the vue-ctk-date-time-picker to display a date time picker modal where users can pick date and time. I use a minDate such that users cannot pick date and time less than the current date and time. This works perfectly with format YYYY-MM-DD HH:mm:ss, but I needed the AM and PM format so I changed the format to YYYY-MM-DD HH:mm a. Now, the PM equivalent of the AM date is also being disabled.
For example, its 8:30 AM, so the picker disables all minutes upto 30 and users can only select 31, 32 and so on. But if I select PM, the minutes are still disabled, ie, the users are only able to pick from 31, when its not even PM yet.
Has anyone faced this problem? Is there a problem with package itself?
For anyone else having this problem, this is the solution according to the document here: https://github.com/chronotruck/vue-ctk-date-time-picker#behaviour
In order to avoid having too much properties in the component, We're
adding a behaviour property that is an object including some annex
behaviour values.
The default value for this object is:
{
time: {
nearestIfDisabled: true;
}
}
To override those values, pass a new object with the values you want
to override:
<ctk-date-time-picker
:behaviour="{
time: {
nearestIfDisabled: false
}
}"
/>

Change date to String format

I need to send a date(ISO) to server from my file(React-native). But backend(node.js) accepts a date in string format.
Date in UI => 2021-02-10T13:01:00.000Z.
Expected Date format in backend is => "2021-02-10T13:01:00.000Z"
I tried date.toString() method. It changes the format of date like Wed Feb 03 2021 16:46:56 GMT+0530 (India Standard Time) this.
Is there any other JS method to change the typeOf date.
Thanks in Advance.
You can use moment : moment documentation
You can use "moment" package to format date.
import moment from "moment";
moment(date,"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",true).format("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")

Now() in ColdFusion (Railo) ORM entity property as a default?

A common design I use is to set a date column with the current date as the default. For SQL Server I use getDate() and for MySQL now() or current_timestamp.
Implementing a MySQL solution in ORM, seemed the way to do it would be:
property name="dtSaved" ormtype="date" dbdefault="now()";
However, this isn't working, but isn't throwing an error either. When I run ORMReload(), it seems to get stuck on this table, and none of the entities that come after (alphabetically) get created. (I'm using dbcreate="dropcreate")
Note that this is Railo 3.3.1, not Adobe ColdFusion 9.
You can set a dynamic default value in your constructor, so something like this:
component persistent="true" {
property name="measurementDate" ormtype="date";
function any init(){
if (IsNull(variables.measurementDate)){
variables.measurementDate = Now();
}
return this;
}
}
Comment by John Whish – November 22, 2010
from:
http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/coldfusion-9-orm-example-215

How do I retrieve the locale-specific date format string in Flex / ActionScript 3?

How do I retrieve the locale-specific date format string in Flex / ActionScript 3? I am unable to find a method to return the actual format string (that which specifies the date format) based on the current locale. I am asking this question because I was hoping to find a way to convert a String to a Date based on the current SHORT date format for the locale. Java allows one to call:
DateFormat format = DateFormat.getDateInstance(DateFormat.SHORT, locale)
to retrieve an instance of DateFormat that formats according to the SHORT format based on the locale.
Does similar functionality exist in Adobe Flex (ActionScript 3) 3? If not, is there a reliable third party library that exists for this?
I'm just found this package that do the job. Here describe the class DateTimeFormatter:
var formatter:DateTimeFormatter = new DateTimeFormatter(LocaleID.DEFAULT, DateTimeStyle.LONG, DateTimeStyle.SHORT);
var result:String = formatter.format(date);
Just cool.
Extending Gojan's answer:
private function cc(event:FlexEvent):void {
var formatter:DateTimeFormatter = new DateTimeFormatter(LocaleID.DEFAULT, DateTimeStyle.SHORT, DateTimeStyle.NONE);
//now if publishDate is a mx:DateField, the formatString of spark and mx components are slightly different.
//So, we replace all d with D and y with Y
publishDate.formatString=replaceAll(formatter.getDateTimePattern(), ["d", "y"], ["D", "Y"]);
}
private function replaceAll(text:String, searchArray:Array, replArray:Array):String {
for (var i:int=0; i<searchArray.length; i++) {
var s:String=searchArray[i];
var d:String=replArray[i];
text=text.split(s).join(d);
}
return text;
}
Yeah I have to say Java is better with dates - you set the locale and automatically your dates are outputted correctly! I can't seem to find such a facility in Flex.
In order to output your dates correctly for each locale I think you have to do what is written in this article: http://livedocs.adobe.com/flex/3/html/help.html?content=l10n_1.html. Maybe you should do this, and in the same class just make these strings which you've pulled from the locale file available to the rest of your app, then you'll be able to operate on them.
Otherwise perhaps this guy's library will help you? I'm not sure.
http://flexoop.com/2008/12/flex-date-utils-date-and-time-format-part-ii/