SMF.UI.showDatePicker Showing Wrong Date - smartface.io

I'm not getting the selected date, but the emulator's system date. Tried publishing and installing on actual Samsung S6, same it's showing system date not selected date. Is there something wrong with my code below?
function Page1_TextButton1_OnPressed(e)
{
SMF.UI.showDatePicker({onSelect:DoSomething});
}
function DoSomething(e)
{
alert(e.date);
}

Your code has some missing but that is not the actual problem. You are probably trying to select a date from past. There is a problem about that and will be fixed with the next release.
By the way I suggest you to use datePicker as in the documents (http://docs.smartface.io/html/M_SMF_UI_showDatePicker.htm).
You should add mask, minDate and maxDate values, etc.
But as I said, although you add these values to your project, it will not work now. The problem will be fixed with the next release.

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?

vb6 error 380 Datepicker, bust just in certain dates

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.

Ember.js and Dates - showing as one day earlier than actual

This has been giving me trouble for a long time now, and I wouldn't think this would be so hard. I have a model with some dates, and date data coming from the API like so:
{
...
tollgate1: '2016-04-15',
tollgate2: '2017-01-01',
projectClose: '2016-10-21',
}
I created a format-date helper (which uses moment.js) to format the dates in view mode, like so:
And that's shows it correctly. However, when I switch to edit mode, the input elements are still referencing the same values, but now they all go one day earlier!
This has been maddening for some time. I've thought it might be due to a like of time zone information in the data, but since I can't change the data that's fed to my app, how can I get it to just display the date in the data, regardless of timezone? For example, with the Tollgate 1 date, I would want it to show April 15 no matter where the user is in the world.
Okay, so as with many things, this isn't an Ember thing so much as just a JavaScript thing. It's really hard learning both at once!
Since my dates coming down from the API don't have a time zone, they're assumed to be GMT, and so my EST timezone of -4 hours makes it show as the day before. Apparently moment.js has some built-in handling so that's why the format-date helper works fine.
What I did to solve is to just add computed properties on my model for each date, and create a new Date object by pulling out the parts from the input date, like so:
function convertDateToUtc(d) {
if(d) {
return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate());
} else {
return null;
}
}
export default DS.Model.extend({
...
tollgate1Date: Ember.computed('tollgate1', function() {
return convertDateToUtc(this.get('tollgate1'));
})
});

Grails Date variable will not set the time

I make a simple domain class
class Meetings {
Date when
String where
}
Then I run 'generate-all' on Meetings. I then start the app 'RunApp'.
In the app I'm able to to choose the month, day, and year for the when variable, however I can't choose the time as in hours:minutes (example 7:30). I wouldn't expect to be able to do this, but if I save the date it formats it as month, day, year, and then -00:00:00. How do I set the time using the date variable? or is there another way?
If you are using the datepicker tag in grails, it is pretty straight forward.
In the views folder under a domain class folder there is _form.gsp. Inside _form.gsp is a date picker tag.
<g:datePicker name="dateTimeVariableName" value="${dateTimeValue}"
default="${new Date().clearTime()}" precision="minute"/>
The keyword here is precision.
You should check the documentation. Its always a good idea. Hope this helps.

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.