vb6 error 380 Datepicker, bust just in certain dates - datepicker

Im having a problem with a datepicker on vb6, but this jus happen on certain dates, for example 31/01/2017, but with another dates it works fine.
I appreciate the help

This almost certainly has to do with how you are setting the date in the control.
For instance if the control's value is ANY month that does not have 31 days then you will get that error. Trying to set the control to 31/02/2017 would cause an error 380.
There are two approaches you can take to fix this.
Reverse the order you set the date components.
dtFecha.Year = Year(fcsAux.Fields("xf3ch4"))
dtFecha.Month = Month(fcsAux.Fields("xf3ch4"))
dtFecha.Day = Day(fcsAux.Fields("xf3ch4"))
Set the Value property instead of the date components. dtFecha.Value = "31/02/2017"
dtFecha.Value = rcsAux.Fields("xf3ch4").Value
The first approach ensures the month is always appropriate for the day. The second approach sets the entire value at one shot and should be a valid date.

Related

TadvGridFilterPanel on TadvStringGrid filters dates wrong

I've got a TAdvStringGrid connected to a TAdvGridFilterPanel. The grid contains several columns of which 4 are dates. The locale of my PC is 'nl-NL' (Dutch). Date format in The Netherlands is 'dd-mm-yyyy'. When I filter dates it doesn't filter correctly. Things I tried that did not help:
In the OnGetFormat returned the ssDate for date columns
Fiddled arround with FormatSettings (local and global) with DateFormat and DateSeparator. This did solve some of the display problems. Date were display as '31/12/2000'. After changing the FormatSettings this changed to '31-12-2000'. But it's not nice to use the global FormatSetting so discarded that solution.
Tried to find an event that fires on compare. If it exists, I didn't find it.
In other words. Or I'm doing something wrong or there's a bug in the TMS code. Any idea's?

How can I compare and check date of program and the system date in MVS 2012 Coded UI test?

I am trying to compare and check the date if it is today's date or not in a spesific program. I tried to use assertion method but when I use it the time will remain same if you try it next day. The main problem that I need to know when open a page from program It should be today's date and should be passed. if you know already anything about it please let me know also :)
Thanks yo!
Use System.DateTime.Now.ToString("yyyy-MM-dd") as one argument of the assertion. You may need to use a different format rather in the ...ToString() method. The exact format depends on how the date is shown on the screen.
This could be done using "StringAssert" to verify that your programs date string contains today's date string, while ignoring the time:
var programDateString = "7/25/2016 12:00:00"; //this is an example of your date retrieved from the application with time included
var todaysDate = System.DateTime.Today.ToShortDateString(); //short date string
StringAssert.Contains(programDateString, todaysDate);

Set date in single line edit on opening

I'm using PowerBuilder 10.5 and I have two single line edit (SLE) fields - sle_date1 and sle_date2 on my window.
What I need is for those two fields to be filled once I open my program. sle_date2 has to have the value of today (for example - 09.07.13), and sle_date1 has to have the value of (sle_date2-30 days) (example 09.06.13).
So, as I said, once I open my programs both fields would be filled immediately with values of today's date and the date of a month before.
How could I do that? Any advice just to get me going?
You can add some code to populate the edits in the open() event of your window
with a given date that can be today(), you can compute a new date plus / minus a number of days with RelativeDate()
The following code just answers your question (though it could be better to use some editmask controls instead of singlelineedit as it would ease the handle of user's input):
date ld_now, ld_previousmonth
string ls_datefmt
ls_datefmt = "dd.mm.yy"
ld_now = today()
sle_1.text = string(ld_now, ls_datefmt)
ld_previousmonth= RelativeDate(ld_now, -30)
sle_2.text = string(ld_previousmonth, ls_datefmt)
It shows 09.07.13 and 09.06.13 at this time.
first of all you need to open your window. You can to this with put this code in your application open event (let suppose that your window is w_main):
open(w_main)
After that in put this code in your window's open event:
sle_date1.text = string(today())
sle_date2.text = string(RelativeDate(Today(), -30))
I think this solves your problem. Here is a little help for RelativeDate:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.pocketbuilder_2.0.pkpsref/html/pkpsref/pkpsref662.htm
Best Regards
Gábor

Change article_custom so that 'past' doesn't exclude an event on the current date

I'm using textpattern and trying to display a list of upcoming events. I'm using article_custom.
<txp:article_custom
form="eventshome"
limit="4"
time="future"
sort="Posted
section="events" />
The issue I have is that this is supposed to show events coming up but using 'future' means that when an event is on the current date it's not showing (it's not future anymore). Both 'past' and 'future' time options seem to exclude the current date. That means people coming on the site don't see an event on that day which is a bit of an issue.
I've had a quick look around the code but can't seem to work out how to change the SQL statement so that future includes the current date.
Any help appreciated.
Its a bit oldie, but since i've just fixed the same issue, i thought i could provide my very simple soution to this matter.
What i did was simply set article date and time to its date and 25:59:59 time, so its visible all day on current day, but disappears immeadetly when day changes.
Since i didn't want to type those times always again and again, i run small javascript on article page which sets those automaticly to fields.
You can try plugin smd_calendar - http://stefdawson.com/sw/plugins/smd_calendar
it supports a lot of methods to display upcomming and past events.

Getting individual values from GWT datebox?

I'm a newbie so please help me in this. I have a datebox with a default date format and its working and displaying selected date in the box as expected.
Now, I need to get individual values from whats being displayed/selected, i.e., month, date, year. I need them to be used to query something in database.
Example : Displayed as July 14th, 2010. I require after displaying it in box, the numeric values as 7(for month), 14(for date), 2010(for the year).
Plese help, I'll be really thankful.
_ Chirayu Diwan
DateBox has a method getValue() which returns an obect of type java.util.Date. This class has individual method to get getYear(), getMonth() (offsets with 0, so 0 is January) and getDay().