time format problem

Hi there,

I want to make typing times, easier for our customers,

I had a timefield, with this format: HH:mm
now they always have to type the ‘:’ which is not handy, so I thought I try this format: HH:mm|HHmm

but now, this only works for 1000 and higher (which becomes 10:00)
if I type: 830, I want it to become: 8:30, Servoy makes it: 11:00 :-(

so I thought I make the format: HH:mm|Hmm
and than it works for 830 (servoy makes it 8:30) but I does not work anymore for everything higher than 1000.
for instance if I fill in: 1010, servoy makes it: 01:10 :-(

anyone seen this or fixed this???

another problem I have seen, as soon as I use a format: like this: HH:mm|HHmm
my custom valuelist on the same field (editable combobox) is not working anymore, it is empty

Here is my customer valuelist:
00:00
00:15
00:30
00:45
01:00
01:15
01:30
01:45
02:00
etc…
etc…

I have tried to make the valuelist like this:
0000
0015
0030
0045
0100
0115
0130
0145
0200
etc…
etc…

but that does not work either…
the strange this is that as soon as I use on 1 field this format: HH:mm|HHmm the valuelist does not work anymore, on any other timefield, (which has still a format: HH:mm)
I’m using Servoy 3.5.7_01 right now and Java 6 u11 on Windows XP

Hope someone can help me out here

What happens when you do this: ‘HH:mm|’ (without quotes)

nothing,

than I can’t type: 1000 I MUST type the ‘:’ so like this: 10:00
and the valuelist is also still broken.

Maybe the converter format is a solution for you?

See: viewtopic.php?f=22&t=11684

Paul

oke, i will go further there, for the inut syntax, but that does not solve my issue, why the valuelist breaks, when I use a format: HH:mm|HHmm

thanks.

that your valuelist doesnt work for HHmm or Hmm is pretty logical

for Hmm the 1100 cant be parsed because there is 1 char to much
for HHmm the 830 can be parsed but parsing happens from the front not the back
so first H maps on 8, second H on 3 and m on 0 and then the last m on nothing (so you are saying 8300)
then you get those auto conversions and you get things like 11:00 or what ever the rollover hours are.

You can do what you want with the global converter on that time field make these 2 global methods:

function fromObject(object)
{
	if (object.length == 3)
	{
		return utils.dateFormat(object,"Hmm");
	}
	else if (object.length == 4)
	{
		return utils.dateFormat(object,"HHmm");
	}
	else
	{
		throw "Not supported input " + object;
	}
	return object;
}

funnction toObject(object)
{
	return utils.dateFormat(object,"HHmm");
}

then place a field and set the format to converter