GWT DatePicker to show specific day of the Week - gwt

How do I show only a particular day of the week in gwt-datePicker ?
E.g
If I select January or any month of the year, I want to see only "Tuesdays" for that month.
Cheers
Prince

Short answer: With the default component you cannot.
I would recommend you to create your own widget. Remember that GWT doesn't have support for the Calendar Object, so you'll need to do your own calculations.

I had a similar requirement once where the datepicker popup needed to show the week number in an additional column. Since you cannot subclass/override all the necessary behaviour of the standard classes, there was nothing for it in the end but to rip out the source code and create a new implementation with minor changes.
As for date calculations, there is a port of joda time which you can import client-side. Quite a bit of overkill if you only need the day of the week, though.
http://code.google.com/p/gwt-time/

Related

Acumatica, creating a generic inquiry with a condition on a field equal to the previous day

I have created a simple generic inquiry that shows some data after joining two tables. I am now struggling to implement a condition that should make the result only contain rows where a date field is equal to yesterday date.
I am a bit annoyed as Acumatica has created the method `today()` neatly, but not a `yesterday()` or `tomorrow()`.
Does anyone have a good solution that they care to share?
Help is much appreciated,
Cheers.
P.s
I have made this very hackish solution that somewhat works, but breaks between change in month or year.
=CStr(Year(Today()))+CStr(Month( Today() ))+CStr( Day(Today())-1)
Okay, so I found the solution to my problem!
I read that Acumatica is coded C# and.NET which made me think of how adding dates is done there. You utilise the DateAdd(date, interval, number) under the time tab to create relative changes to date.
In this case, the date is the time source from where you want to change, interval is in which interval/dimension you wanna move, for example, 'd' is for days. You can find more prefixes here: crosspost. Lastly, number is how much you want to change in the interval, in my case -1.
TLDR; Use DateAdd(Today(), 'd', -1) to get the previous date in relation to the current date.
You can simply write Equals to #Today-1 for Yesterday like below:

How to protect Only Month and year of date in Powerbuilder

How to protect only Month and Year of a date in Powerbuilder so user can only edit day of the date?
As comments suggest, this reads more like a user requirement than a technical question (e.g. lack of mention of what type of control is involved), but if this were my requirement, I'd try one of these (user exercise to figure out which ones would actually work; it's not my requirement grin).
EditChanged: I'd put a date EditMask on a DataWindow (remember external DataWindows; it's a common misconception to think that controls on DataWindows have to be tied to a database column), and code the EditChanged to revert the year and month back to their set values if they've been changed. (I'd consider this pretty aggravating for the user, but it's possible)
Day field: Make the year and month StaticText, and make the day only an editable field. Edit, EditMask or EditMask with spin control would be appropriate for this (spin gives you control over the range with minimal scripting).
Custom control: Grab the source code for a dropdown calendar (PFC comes to mind), and customize it to disable the navigation between years and months.
Good luck,
Terry

Grouping Expert, Current date against start date

I am having trouble grouping certain results in a work in progress report that arranges by start date, I have grouped using fixed values before but because the dates keep moving I am unsure what to do.
The start date is WIP_Schedule.Start_Date
the groups I am trying to create are:
[Group1] Overdue = the current date has passed the start date.
[Group2] (Yet to be named) = the current date 2 week period prior to the start date
[Group3] To Do = the current date after the two week period prior to the start date.
I am after a works instruction on how to achieve this.
I know this isn't a lot of information, if you require any more please ask.
Thanks,
Daniel
This is a pretty straightforward requirement, so you should be able to figure it out by searching the web. However, I'll give you part of the answer and hopefully you can figure it out.
Start by creating a formula to figure out the status of the date.
If {WIP_Schedule.Start_Date} > current date then "Overdue"
Else......
Then you can group based on that formula. All you have to do is figure out the rest of the formula.

How to get last day of the month in Cocoa?

I would like to make a function that input a NSDate and output the last date of the month. Do you guys know how to do it in Cocoa?
It's the day before the first day of the next month. Add a month, set the day to 1, subtract a day. For setting the day to 1, you'll find it easier to go via NSCalendar. See here for details.
If you're doing date computations, you should always use NSCalendar and related classes, because that's the only way to be forward-compatible with changes to calendars, support for non-"standard" calendars, and so on.
Read the Date and Time Programming Guide section on Calendrical Calculations to get an idea of how these classes work together.

ExtJS: ask birthdate

the calendar offered by ExtJS is not very intuitive for entering a birthdate, is it possible to use three separate fields (year, month, day) connected to each other and submit to the server only one value which is a composition: YYYY-MM-DD?
Or is there any good way to get a nicer calendar for entering a birthdate in an intuitive way?
Thank you.
Why isn't the ExtJS Datepicker worth for entering birthdate? In which field do you think it isn't proper - year, month or day? Yes, it is not same as 3 drop down lists with year month and day, but it provides absolute usability with least amount of code to select a date.
To answer your question as asked, you can use an xtype of "hidden" to send the date formatted how you wish.
Using a common blur event on the three dropdowns or textboxes you choose, you check to see if all three have been filled in and pass simple validation. you then set the value of the hidden field based on the format that you choose from the 3 separate fields.