I have problem with richfaces calendar. I want to see only year and month so i made datePattern="yyyy/MM", which works fine until i want to change date.
When i click on button and calendar pop up the current value disappear. If i don't select date the value is null. I tried to save old date in my bean but problem remains because when i open calendar it is always set to todays date.
Problem occur only when i don't put dd(days) in datePatern
<rich:calendar value="#{myBean.date}" datePatern="yyyy/MM" />
Tnx for help in advance
I got answer on richfaces forum so i will copy it also here
I guess rich:calendar is not the right choice at you case although rich:calendar may be bound to probably any object type provided that you supply custom converter a day ordinal still should be supplied because it's a part of the date maybe you would do better with a h:selectOneMenu to specify a month and a h:inputText to define a year instead of "incomplete" rich:calendar
Related
I would like to display a date picker in my app, but I need to set the the limits on the earliest and latest shown dates. How can I do it with Codename One PickerComponent? Or are there any other better ways to do it?
Solution found - my PickerComponent must include both setStartDate() and setEndDate().
Example --
Using DayPickerRangeController from airbnb/react-dates (12.7.1), I would like to display the week number on the left of the day picker for each weeks.
Here is what I currently have
Here is what I would like to see on my calendar
Is there any prop that can help or is there an already existing solution?
airbnb/react-dates does not support any props to display the week no.
You can have a look at rc-calender as other alternative.
As mentionned by #ShridharBavannawa, there's currently no support for displaying week number. However, there's a related issue open on github where Jussi Niinikoski suggests a hack that help; Instead of displaying week number on the side of each week, one can display them in every date cell with the renderDayContents property as follow:
renderDayContents={(day) => (
<>
<p>{day.format('W')}</p>
<p>{day.format('D')}</p>
</>
)
Where day would be a momentJS object. You can then style the cell to your taste.
I am trying to display initial values on my redux form when it first load. Every fields work except the date input field. I tried to use moment to format string (YYYYMMDD) to MM/DD/YYYY and it's not working. No matter how I formatted, the field fail to display and instead showing the default place holder character mm/dd/yyyy until I selected a date. I am using the default redux-form input component date type. How should I do this right? Appreciate for any help.
When you are setting the initial date in your state, you need to provide it as per ISO-8601 standards, so YYYY-MM-DD, i.e. 2018-08-22 for 22nd August 2018.
I have never used redux-form library before, but I found a codesandbox example in their guide, and managed to get it to work here by just relying on them having followed the ISO standard. Feel free to play around with it.
I am using this calendar https://github.com/mattlewis92/angular-bootstrap-calendar for showing events and time slots for people all over the world. During sign up, every user has to set his timezone and then my application uses this timezone for further date computation rather than client machine timezone.
The problem is that when I make user timezone default using moment.tz.setDefault(timezone) and change the machine's timezone, the calendar calculates dates wrongly.
Here is my excerpt of my code:
moment.tz.setDefault($rootScope.timezone)
vm.calendarView = 'month';
vm.viewDate = moment().startOf('month').toDate();
vm.cellIsOpen = true;
Attached is the screenshot:
[Screenshot]
You can see that user's timezone is currently Asia/Karachi +5 and my machine's timezone is Beijing +8. Today's date is 8 September and the day is Friday, but on the calendar 8 September is showing as a Saturday instead of Friday.
mwl-calander did not provide support for timezone, you can use full calander
https://fullcalendar.io/
Demo https://fullcalendar.io/js/fullcalendar-2.9.1/demos/timezones.html
Its angular directive can be found at
https://github.com/angular-ui/ui-calendar
It would appear that this particular UI control does not support selecting a time zone. Simply using moment.tz.setDefault is not good enough, because everything the control is doing both internally and in its external API is using Date objects, which cannot represent arbitrary time zones. In other words, the author of that control would have to remove all .toDate() calls and use Moment objects as the primitive in the control instead of Date objects. That would be a breaking change for them.
I suggest filing an issue in that project's GitHub repository, and reference this page.
When we select a date from the angular Datepicker and my model is empty first time, then it selects one day back date.
If we assign current date first time in the model, then it works fine.
Check here
and here
It seems that in both, changing the date format seemed to fix the problem.
Also, welcome to Stack Overflow :)