Dojo dijit/form/DateTextBox - customizing message for values out of range - dojo

In dijit/form/DateTextBox I can change the data-dojo-props="constraints: { datePattern: 'yyyy-MM-dd', min: '2000', max: '2018'}, invalidMessage: 'Choose date as yyyy-mm-dd'" to set format, range, and change the message shown when the date is in wrong format. But when the date is just out of the range 2000 to 2018 I get a different message. How to customize that one? Dojo documentation doesn't help - it says something about min and max, but doesn't state what message is shown neither how to change that.

You can user the rangeMessage property:
data-dojo-props="constraints: { datePattern: 'yyyy-MM-dd', min: '2000', max: '2018'}, invalidMessage: 'Choose date as yyyy-mm-dd', rangeMessage: 'Choose a day between 2000 and 2018'"
This property is documented in the Dojo Toolkit API reference. Select dijit/form/DateTextBox and make sure that 'Inheriteds' is checked.

Related

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
}
}"
/>

Getting previous period/same period last year attribute filter

I'm trying to enable drill-ins for measures which are specified as "previous period" or "same period last year" of another measure. When a drill event is fired, the intersection I get looks like this:
[
{
id: 'fkdljsfkdljfdkslj_pop',
title: 'Constituents',
header: {uri: '/gdc/md/projectid/obj/12345', identifier: 'ahdueom'}
},
{
id: '54321',
title: 'Oct/FY2018,
header: {uri: '/gdc/md/projectid/obj/6789', identifier: 'constituentdateadded.month.short'}
}
]
What I want to do is use this information to call getValidElements (/gdc/app/projects/projectid/executeAfm/debug) to get the items involved in this drill event using the first intersection element as a metric and the second as an attribute filter. However, if I want to get the items for the previous period or the same period last year I need a different attribute filter.
Is there any endpoint that I can call to get the attribute filter which corresponds to the same period last year (in this example 'Oct/FY2017') or the previous period ('Sep/FY2018')?
Maybe you could use relative date filter in AFM to simulate previous period. Documentation is here https://sdk.gooddata.com/gooddata-ui/docs/filter_visual_components.html#relative-filter-examples
If whis won't help you, could you please specify more your use case - what exactly you want to achieve?

yadcf - range date filter - jquery-ui datepicker

is possible to set in this datepicker weeks starts on Monday?
Here is a fiddle to explain this.
The second column (date) is a range date and when you try to select start date in the filter the weeks always start on Sunday.
Thanks in advance.
You should use the filter_plugin_options of yadcf in order to pass the third party plugin its init options, in this case the following will do
{
column_number: 1,
filter_type: 'range_date',
filter_plugin_options: {
firstDay: 1
}
}
See working jsfiddle and read related answer
Always bet on yadcf

Google BigQuery seems to run in the Pacific Time zone not UTC. Is there any good reason for this? Is there any way to change it?

UDF:
bigquery.defineFunction(
'newdate', // Name of the function exported to SQL
[], // Names of input columns
[
{name: 'date', type: 'timestamp'}
, {name: 'datestr', type: 'string'}
],
function newDate(row, emit) {
var date = new Date(); // current date and time
emit({
date: date
, datestr: date + ''
});
}
);
SQL:
SELECT date, datestr
FROM (newDate(SELECT "ignored" AS inputA))
Output:
1459282876835809 Tue Mar 29 2016 13:21:16 GMT-0700 (PDT)
That's an unfortunate oversight on our part.
Many Google servers run using Pacific time (semi-jokingly referred to as "Google standard time"). When launching BigQuery, we tried to standardize on UTC instead, but we missed this case. We may try to find an opportunity to fix it, but unfortunately we risk breaking existing users if we do so, so no promises.
Thanks for the heads up!
Don't know rationale for running in Pacific time zone, but you just ignore the system time zone, and use UTC time in your code.
E.g. use datestr: date.toUTCString() instead of datestr: date + ''.

Getting view options in Microsoft Project using VBA

If I want to change the current date format to 20, for example, I can use the command
OptionsViewEx DateFormat:=20
but how can I get the current date format (or any other view option for that matter)?
DefaultDateFormat should be the function to use.
oldvalue = Application.DefaultDateFormat
Application.DefaultDateFormat = 20 ' or = pjDate_mm_dd_yyyy
This gets or sets the default date format. (technet)
This gives the complete list of format types.
If you use Date function get a date in current format, but if you need change use format(Date,"yyyy-mmmm-dd") for example.