Is there a way to specify first-day-of-week for Vuetify Date picker globally? - datepicker

Is there a way to specify first-day-of-week for Vuetify Date picker globally?
I don't want to specify the props on each separately.

No, there isn't a way to do that
You have to use the widget as per documentation (https://vuetifyjs.com/en/components/date-pickers) with the first-day-of-week property.
<v-date-picker
v-model="picker"
:first-day-of-week="1"
></v-date-picker>
if you look into code, you'll notice that the param default is 0, so there's no magical global setting for this.
https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/components/VDatePicker/VDatePicker.ts#L64

As for few other components' defaults, you can simply wrap it in new component (let's call it MyDatePicker) and use that one across the application instead.
To harness all event handlers intended for Vuetify component VDatePicker upon your custom MyDatePicker, you'll need to add v-on="$listeners".

Related

How to display a simple wicket message with one simple parameter with StringResourceModel

I have one Wicket text property in the WicketApplicationProperties.properies
<entry key="dataMniejszaNizMinimalna">Wybrano datę, która jest mniejsza niż minimalna akceptowalna data '${minimalnaData}'. Nie można zapisać danych."</entry>
How to substitute a parameter {minimalnaData} with a use of a class
StringResourceModel. I don't want to create any models i want to just display a message with provided one attribute. The Wicket StringResourceModel is so complicated.
new StringResourceModel(resourceKey).setParameters(params)
how to provide this one parameter is a simplest way.
The simplest way could be:
new StringResourceModel(resourceKey, this, Model.ofMap(Map.of("minimalnaData", "some value")))
The model object could be a Java Bean or a java.util.Map.
StringResourceModel also supports java.text.MessageFormat. You can use its #setParameters() method to pass an array of values for the placeholders.
I think wicket:message should fit your need. Take a look at the wiki:
https://cwiki.apache.org/confluence/display/WICKET/Wicket%27s+XHTML+tags
You can nest components within textual content.

Is there a way to know from which a form is opened?

I work on Dynamics-crm 2016 version, I need to know from where a form is opened (grid, button etc) in ON-PREMISSE dynamics 2016, is it optional to get that data?
This can be solved in multiple ways. My simple suggestion: Add a boolean field on the form, set it default to false. Add some javascript that subscribes to the forms onLoad event. The logic changes the bool value to true. Thus when the form is loaded (opened), the JS code runs and sets the field to true. You can also timestamp it and set it to readonly.

Mask input for sap.m.Date(Time)Picker

With the sap.m.DateTimePicker, it's possible for a user to either select a value from the drop-down list or enter it manually. I'm wondering if there's a way to add a mask to the manual input box that matches the valueFormat of the DateTimePicker.
I know there's a sap.m.MaskInput as well, so maybe there's a way to combine the two elements.
There is a new private module named sap.m.MaskEnabler which the sap.m.InputBase (i.e. DateTimePicker) is supposed to make use of.
(MaskEnabler) should be applied to the prototype of a sap.m.InputBase.
The mask feature is currently enabled only in sap.m.TimePicker (v1.54). According to this commit message, however, the same feature will arrive to the Date(Time)Picker as well:
This change prepares for refactoring of DatePicker and TimePicker so the
common code of both pickers can be moved to a new common control that
they may extend.
Therefore, if it's not urgent, and depending on your project, I'd not create a new custom control and then throw it away once the mask feature has arrived.
I'll update my answer when it's available.
Until then (and even afterwards), you can still guide the user to enter the data in the correct format via OData binding type sap.ui.model.odata.type.DateTime:
<DateTimePicker
value="{
path: 'myODataModel>myDateTime',
type: 'sap.ui.model.odata.type.DateTime',
constraints: {
isDateOnly: true,
displayFormat: 'Date'
}
}"
minDate="{...}"
maxDate="{...}"
/>
In contrast to formatter, type allows us to keep two-way data binding.
The entered value is automatically intercepted from updating the model data when...
It could not be parsed due to an invalid format (fires parseError)
It could be parsed but the constraints were violated (fires validationError)
If you enable handling UI messages
additionally, the framework will then take care of creating the appropriate
message for the user:
Example: https://stackoverflow.com/a/48482544
I think the only way to combine the two sap.m.DateTimePicker and sap.m.MaskInput is to develop your own control . Documentation : https://sapui5.hana.ondemand.com/#/topic/91f1703b6f4d1014b6dd926db0e91070.
Another way is to just use the Placeholder of the DateTimePicker Input field. This does not provide the same functionality as a MaskInput, but helps the user which valueFormat is expected in the input when entering it manually.
If you have a binding in your input box, you could set the type in the binding to eg. sap.ui.model.type.Date. This way you get some automatic formatting when field validation is triggered. There are other types available and you could inherit from sap.ui.model.SimpleType to code your own.

dhtmlx scheduler adding custom inputs

Is there any possibility to add a custom input form on dhtmlx scheduler such as text, select, texarea, etc.
Because i desire to add my custom items on it like etc.
Thanks in advance!
You can add any number of predefined inputs or implement a custom ones, check these articles
http://docs.dhtmlx.com/scheduler/custom_lightbox_editor.html
http://docs.dhtmlx.com/scheduler/lightbox_editors.html
You can also redefine the details form completely, as described here
http://docs.dhtmlx.com/scheduler/custom_details_form.html

Event listener on select field in Symfony 1.4

I got two select fields in my symfony project: ContrySelect and StateSelect. They are implemented with the sfDependentSelectPlugin. I just want to know if does it exist a way to listen to the events of the CountrySelect so I can set or unset the StateSelect field.
Thanks in advance.
I only worked once with this plugin.
It has an option for the sfWidgetFormDependentSelect which is called 'ajax'.
See doc:
ajax = false: Specifies whether remote calls are used to populate the
select values,
This may be an option.
Otherwise I would advise you to just create a custom javascript listener on your CountrySelect that will set the other widget.