how to configure datefield xtype in dialog to just show list of years for selection instead of m/d/Y in aem - aem

how to configure datefield xtype in dialog to just show list of years for selection instead of m/d/Y in aem.
I tried to configure it using the format property, and was able to just get the year when i select any date from datefield.
Is there a way to just show the years.

The calendar xtype does not expose any method or property to suppress the display of month and day. This is because the control returns a full date which must contain a day, month and year value.
Assuming your business logic dictates some upper or lower bound for year, i.e. 2017 means 1 Jan 2017 or 31 Dec 2017, then you are better off using a drop down list for year selection and saving the value in correct data type in accordance to your business requirement.

Related

Quicksight datepicker for month only

I'm searching for a way to have month selection and that will serve as startdate and enddate for the date filtering.
I'm building a monthly report on quicksight, I try to use the last 31 days but that give information of multiple months
I already create date picker for those parameters but didn't find any way to limit the value to be the complete month only.
Example : if select the 12 september I desire to get the September values only (from the 1er to the 31th)
Any advice is welcome
Thanks for your help
First, add a new date filter (if you want, e.g., today to be the default you'll need to add a dynamic default against a data set that returns today)
Add a new control (I found naming this to be difficult, perhaps you're better at picking names than I am)
Add a new calculated field that returns 1 if the truncDate of your date field and the truncDate of your parameter are equal, otherwise return 0
ifelse(
truncDate("MM", {date}) = truncDate("MM", ${InMonth}),
1,
0
)
Finally, add a filter that checks where your calculated field is 1 and apply it to all visuals

how can i get the value from datapicker using angular day, month, and year separate

am using angular 6 datepicker i need to get the date selected, separate day and month and year
this.search_form.controls["startDate"].value
console.log("full date",this.search_form.controls["startDate"].value);
console.log("day",this.search_form.controls["startDate"].value.date().toString());
console.log("month+1",this.search_form.controls["startDate"].value.month().toString()+1);
console.log("year",this.search_form.controls["startDate"].value.year().toString());
I need to get day=3 month=4 year=2019 also get the date as 03/4/2019
Use for separate date ,month n year
See the example below:-
Overview for datepicker
The datepicker allows users to enter a date either through text input, or by choosing a date from the calendar. It is made up of several components and directives that work together
Basic Datepicker:-
Connecting a datepicker to an input
A datepicker is composed of a text input and a calendar pop-up, connected via the matDatepicker property on the text input.
If you want to set the start date you have to use the 'startAt' property of the .
To select month and year you have to use monthSelected and yearSelected property of the

Tableau create a filter with several values in one option

I made a year over year percentage difference of some value in a pivot table. It works ugly: If Year=2018 is selected, the percentage is treaded as 100%. If I choose Year IN (2018, 2017), I can see the proper percentage diff for Year 2018 compared with 2017 treaded as 100%.
One idea I have is to create a radio filter that works like this:
If a user selects Year=2018, I want to show data for Year IN (2018, 2017). So actually two values are selected. The table pivot part with 2017 year is hidden though.
This should work for several Year options.
Is this possible?
What you are looking for are all the years whose difference to the argument is at max one year. So if you choose 2018 as argument, you want to choose 2018 and 2017 from the data, if you choose 1997 you want 1997 and 1996.
So, create a parameter [Date Argument] for your target year. Then create the condition:
DATEDIFF('year',[Date],[Date Argument]) = 0 (OR 1) and add it to the view.
However, I believe what you are trying to do could be more easily achieved using a table calculation.

XPages date field value changes from AM to PM

I have created a managed bean to handle monitoring field changes on an XPage. The application requires that all changes to fields be logged. I have integrated the bean into a custom control on the XPage and it is created/instantiated when the user toggles the control from read only to editable. There is one Date/Time field set up to display only the date. The Notes document field is also set to display only the date. When the bean is instantiated and the SSJS obtains the date via getComponent - it returns the date like this: mm/dd/yy 12:00 AM. I have another button configured to get all the updated field values when it's clicked. When I click the second button it flags the date field as having been changed when it hasn't. The "updated" value is: mm/dd/yy 12:00 PM. If I trigger the initial and update code in the first button I get AM for both values. When I trigger both initial and update after the control is switched to edit mode by itself I get PM for both values. So it seems that getComponent is returning different values based upon the partial refresh event for readonly to editable. I tried using the afterRender event, but still get the AM/PM problem. Has anyone else encountered this problem? If so, any solutions? Assuming it's an issue with the mode change, any suggestions on how to capture when the change is complete and then trigger my code?
The default value for a date/time field which only stores a date is 12:00 midday. That's to handle Daylight Savings Time adjustments and I suspect the Java Date() to NotesDateTime conversion is doing the manipulation. (NotesDateTimes that are date only are stored with no timezone, so any conversion of 12:00am across DST boundaries may end up changing the date, whcih you don't want; e.g. adjusting 6 June forward 6 months with a time of 12:00AM would change it to 5 Dec, because it would drop back an hour.
I would recommend setting a default value that includes 12:00PM

Xpath current date

I have a webpage where a row displays name, relation and date. I want to search for the matching row as per my values. Using Xpath, I have built the below mentioned code. The only problem is the last part (the date). I want to pick up the current date and fit it into the search query..i.e. instead of 30 Sep 2013, I want it to search for 01 Oct 2013 (assuming today is this date).
Any clue how can i do that??
$x('//tr[descendant::b[text()="text1"] and descendant::a[#class="bill" and text()="for Automation"] and descendant::td[text()="30 Sep 2013"]]')
You have to build the expression dynamically and append the date string at the end based on some date object. The specific implementation depends on which programming language you're using