I need my slack bot to support user input date and time, I know there is DatePicker which I can input a certain date. But I also need time, I am thinking to use a text field to just input string, but it's annoying that users have to deal with format stuff every time.
Is there a better way to do this? or is it possible to make a date time picker by myself?
edit:
Users might input any specific time, any hour or minute.
The Slack API currently only provides a date picker, not not a datetime picker.
However, you can create a datetime picker yourself: Combine a date picker element with a static select menu element that has all the time options and voila you have a datetime picker.
This would be easiest to be implemented in a Modal, since this allows a user to set values for multiple elements at the same time.
Here is an example with block-kit. Depending on the granularity of your time values you may want to generate the list of options programmatically.
And if you need to provide a more granular input, like down to the minute, then I would suggest to place two selects:
First for the hour (00 - 23)
Second for the minute (00 - 59)
Here is an updated block-kit example on how this would look.
And here is a screenshot of the example:
Dito for seconds if you need them.
The maximum allowed number of options for a select element is 100, so this will work.
Slack now has a timepicker: https://api.slack.com/reference/block-kit/block-elements#timepicker
The dropdown portion of this element groups time by the hour. The element also offers the ability for text input so that you can set a granular time (like 5:42 PM).
This can be used as an accessory or a standalone element. The documentation outlines how to use it as an accessory. To use it as an element, you'd place this into the "element" part of the block:
{
"type": "timepicker",
"action_id": "some action id you define",
"initial_time": "2020-10-09",
"placeholder": {
"type": "plain_text",
"text": "This is a datepicker!",
"emoji": true
}
}
Related
I'm building a Google Home skill using Dialogflow. I want the user to be able to say a date time such as "today at 3pm", "Wednesday at 11am", or "August 10 at 5pm."
Dialogflow has several prebuilt entities including: date, time, and date-time. For some reason the system seems to always parse date and time separately instead of just as date-time. I've tried putting in several examples and manually setting the entity type to date-time but whenever I add another one it always parses them separately.
Any ideas how I could force it to extract date-time as one entity?
You can use #sys.date-time or can have a composite custom entity and use it for the intents. There could be any combination of the entity that you can put there. Once you extract it, you can use regex to extract date and time in your webhook.
Entity
Intent
I would like to trigger an email when a new Time entry is created in Netsuite. Usually this can be easily accomplished through a Saved Search/Email but for Time searches, sending on Create is not available and already the topic of an enhancement request.
I've created a Workflow which will trigger upon Time entry create. In order to use the time entry fields I first created Workflow Fields and then in State 1 populate those workflow fields with the values. Suiteanswers: Use SQL expressions in Send Email action via the Workflow Manager (ID: 21669)
I can map many of the fields like Customer:Project, Service Item from the Time entry into my Workflow. I am stuck on mapping the Netsuite Duration field which according to the Records Browser is of a type "timetrack" ie 1:05.
I have tried it from the available field types, Date, Date/Time, Integer. I'm now trying to populate is into a Text field but am stuck as to how to convert it from the timetrack record type into Text.
Have tried
TO_CHAR({hours})
CAST({hours} AS text)
I just want a field with the Duration that I can use in an email. :)
How could I achieve this affect? Any thoughts appreciated.
Turns out that somewhere along the track I over-complicated what was needed. In the end I just inserted {hours} into my email text box and it worked. I can't explain why it didn't work initially.
I use standard dojo date picker and it works fine. Only problem is that actual value that is saved to the document has always 12:00:00 time part. I assume it probably tries to set 12 AM, but since I'm in Europe (CET time zone) it really means noon.
This is quite annoying when I try to do date/time comparison later.
I found posts how I can strip time part completely, e.g. XPages - save date only in Date field , but it needs extra code in post save and in some cases I can't use post save because of access rights.
I understand that XPages work with Java Date that has no option for date only, but at least it should return just 00:00, not 12:00. When I tried to play with timezone setting on the converter I got even different time values in the field.
I was able to change the behavior using custom renderer and component for the datetimehelper, but it is really an overkill. Standard implementation bypasses used convertor, so just custom converter didn't help.
Is there any way how to force the date field to just return date with 00:00 time part? I don't expect any magic where it would save just dateonly field to the document.
Thanks,
M.
No, it's not trying to set 12am and being affected by timezone, what you're seeing is standard. I think it started with 9.0. I suspect the timing is to avoid impacts from Daylight Savings Time changes.
One option is to call .setAnyTime() on the DateTime object for the field.
I am on Movable type 5.2
How would I create a weekly event calendar (7day) using MT tags? I am aware of the MTCalendar tag but this tag does not support weekly dates.
I would like to create "What's going on this week" type of display.
I don't see a way to do it using the standard template language, but you can probably make a very simple plugin to help you here.
Your options:
A block tag that loads the entries for this week.
A conditional tag that is true is this calendar week is the same as the entry week. (so you can use it inside the calendar tag)
A tag that set variables for the start and end timestamps, so you can compare them with entries's time.
Good luck.
How can a workflow be told to wait until a specific date, or date field?
It works with timeout equals date, but I would much rather use wait until process time is on or after date.
When I try this the workflow is postponed until our distant ancestors have died of old age; it is the same if I put in a date field instead of a specific date (which is the end goal):
You want to consider what is considered a "timeout" for the desired behavior. The following links provide some more context.
Also, unless you have a really specific use case for using a specific date (like year end deadlines or processing) -- you'll probably want to use a datetime field on an entity as the basis for the right side of the comparison. You can always use the dialog on the right to choose a fixed date/time before or after any of the entity datetime fields.
http://social.technet.microsoft.com/wiki/contents/articles/11291.microsoft-dynamics-crm-2011-workflows-wait-and-timeout.aspx
http://www.powerobjects.com/blog/2012/11/06/multiple-waiting-workflows-wait-conditions-and-timeouts/
http://www.dynamicscrmtrickbag.com/2009/07/12/waits-timeouts/
Yes, it will use the current value of the field each time the workflow is checked.
Related: CRM2011 Workflow: What happens if the field which is used in the condition of the workflow is updated after the workflow has started?