I am trying with the telerik kendo ui for angular 2 (http://www.telerik.com/kendo-angular-ui/)
working on the datepicker, don't know why it looks like the datepicker adds one month to the binding value. As you see it in this plunker http://plnkr.co/edit/8yUqiagcZ957saufxYpS?p=preview
The date is set to new Date(2000, 2, 10); but the control displays 03/10/2000.
I want it displays exactly as set( e.g 02/10/2000). How can I do?
JavaScript Date object accepts zero-based month values, unlike the days and years for instance.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
That being said, just pass 1 to display "February".
new Date(2000, 1, 10)
http://plnkr.co/edit/pb09ZPo4L18ExGYOcu4x?p=preview
Related
I'm using Liferay 7.1 I have the following liferau-ui:input-date object and I want to pre-select a date:
<%
final LocalDate today = LocalDate.now(ZoneId.systemDefault());
%>
<liferay-ui:input-date
dayValue="<%= today.getDayOfMonth()%>"
monthValue="<%=today.getMonth().getValue()%>"
yearValue="<%= today.getYear()%>"
</liferay-ui:input-date>
When I output today's values directly on the JSP I get the correct date for today: 3 12 2018.
When the element is rendered, it has selected the wrong date: 01/03/2019. There is nothing further documented in the taglibdocs that I think could help.
How can I fix this?
The problem is the month value. In Java it's 1-12 with liferay datepicker it's 0-11.
In order to display the correct month i subtracted 1 from month value. It's not an elegant solution but i couldn't find any better way.
<liferay-ui:input-date
dayValue="<%= today.getDayOfMonth()%>"
monthValue="<%=today.getMonth().getValue() - 1 %>"
yearValue="<%= today.getYear()%>"
</liferay-ui:input-date>
This will render 12/03/2018
I am currently working with Primefaces 6.2 and JSF 2.2 and I am trying to build a bar chart. The chart itself is being rendered properly, but right now, the datatip of every value is the "y" value concatenated with the "x" value:
barModel.setDatatipFormat("%d - %.2f");
Ex:
'1 - 132.70',
'2 - 96.00',
'3 - 103.25'
....
What I need is to display only the second value:
'132.70',
'96.00',
'103.25'
....
But every time I try to make something different like barModel.setDatatipFormat("%.2f");, only the first value is formatted and shown.
Is there a way to, for instance, ignore this first value? Thanks in advance.
EDIT: I tryed to do the same as this question, but there is no <p:lineChart.../> tag in Primefaces 6.2
You can use parameter index in your format String, as it's a classical format supported by String.format or System.out.printf. Parameter index starts at 1 not 0.
In your case, just try this "%2$.2f".
See also : http://devdocs.io/openjdk~8/java/util/formatter
I am using ng bootstrap datepicker to set up a calendar.
But my requirement is, instead of the calendar to display the current Month as it does. I need it to display the next Month..i.e January.
I read through the documentation and I can't seem to find a way to customize this.
Is there a way to do this ?
To change the default of the month being displayed ?
It's a basic datepicker :
<ngb-datepicker #dp [(ngModel)]="model" (navigate)="date = $event.next"></ngb-datepicker>
Is there a way to set the calendar picker in Silverstripe to not be able to select dates that are in the past?
As far as I can tell it uses the jQuery DatePicker but I am unsure how to restrict the past dates.
DateField::create("Date","Date")
->setAttribute('placeholder','eg 2017-01-01')
->setConfig('showcalendar', true),
You can pass configuration options to the datepicker:
DateField::create("Date","Date")
->setConfig('showcalendar', true)
->setConfig('min', date('Y-m-d'))
->setDescription('')
->setAttribute('data-number-of-months', 3);
->setConfig('min', date('Y-m-d')) tells jQueryUI picker to use a minimal date (today). With data-attributes you can also pass other configuraton to the picker, in the above case it shows three months at once. This will be passed to datepicker config.
Note that the datepicker camel case config "numberOfMonths" has to be written with hyphens like 'data-number-of-months'.
See also datepicker configuration
I am using the angular UI bootstrap popup datepicker like the example here :
http://angular-ui.github.io/bootstrap/#/datepicker
When i combine this with the uiMask Directive ( http://angular-ui.github.io/ui-utils/) the values in the input get scrambled when i pick a date.
I suspect because of the difference in type on the angular model : datepicker wants JS Date object/ ui.mask wants (masked) string.
When the picked date gets formatted/parsed by uiMask, it goes wrong :-/
Is what i am trying to do even possible ?
kind regards, Tom.