This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unusual behavior in Change Attributes dialog
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Total Commander Forum Index -> TC9.2x bug reports (English) Printable version
View previous topic :: View next topic  
Author Message
MarcinW
Power Member
Power Member


Joined: 23 Jan 2012
Posts: 763
Location: Poland

PostPosted: Wed May 09, 2018 5:08 pm    Post subject: Unusual behavior in Change Attributes dialog Reply with quote

Steps to reproduce:

1) select any file on a FAT32 partition
2) launch menu Files -> Change Attributes
3) in Date field, enter just 2018
4) clear Time field
5) press OK - nothing will happen

6) select any file on an NTFS partition
7) launch menu Files -> Change Attributes
8) in Date field, enter just 2018
9) clear Time field
10) press OK - date will be set to 2559-01-01

Regards
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35473
Location: Switzerland

PostPosted: Thu May 10, 2018 9:38 am    Post subject: Reply with quote

It's because TC sees it as day=2018, month=0, year=0. This leads to erroneous timestamp values. I will show an error instead.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MarcinW
Power Member
Power Member


Joined: 23 Jan 2012
Posts: 763
Location: Poland

PostPosted: Thu May 10, 2018 4:27 pm    Post subject: Reply with quote

ghisler(Author) wrote:
It's because TC sees it as day=2018, month=0, year=0

But when I enter 5000, I get 2559-1-1.

When I enter 0, I get 2559-1-1.

And FAT32 behaves differently than NTFS...

So it doesn't seem that it's just because TC interprets the value as number of days.
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35473
Location: Switzerland

PostPosted: Fri May 11, 2018 2:28 am    Post subject: Reply with quote

2559-1-1 is just a placeholder here for an invalid date.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MarcinW
Power Member
Power Member


Joined: 23 Jan 2012
Posts: 763
Location: Poland

PostPosted: Fri May 11, 2018 5:10 am    Post subject: Reply with quote

Ok. So I think it would be best to do this in two steps.

Initial note: currently, in Time field, if you enter for example 1:23, TC extends it to 1:23:00. When you enter 1, TC extends it to 1:00:00. This is very nice and useful (at least for me).

So the algorithm could be:

Step 1) Extend Date and Time information entered by the user:
- date 2018-5 extend to 2018-5-1 (this will need to respect regional settings, because various date orders may be used, like y/m/d or y/d/m)
- date 2018 extend to 2018-1-1 (as above)
- time 1:23 extend to 1:23:00
- time 1 extend to 1:00:00

Step 2) Verify, that the final information is valid - for example warn, if the obtained date is 9999-99-1 or time is 99:99:00 (because the user entered 9999-99 as date or 99:99 as time).

Regards
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35473
Location: Switzerland

PostPosted: Sun May 13, 2018 1:49 am    Post subject: Reply with quote

Time is already extended. However, date will not - when the user just enters 2018, it's not clear what date and time he wants. Also the year isn't the first value in most locales.

But I will show an error now when the date or time is clearly wrong, although I will allow some exceptions like 24:00 = 00:00.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MarcinW
Power Member
Power Member


Joined: 23 Jan 2012
Posts: 763
Location: Poland

PostPosted: Sun May 13, 2018 3:49 am    Post subject: Reply with quote

Great!
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35473
Location: Switzerland

PostPosted: Wed May 16, 2018 10:37 am    Post subject: Reply with quote

This should be fixed in beta 3, please test it!

You will get just <Error!> when the translation is missing, otherwise string 1396="Invalid input!".

It will also list the fields with errors. Currently date+time fields are supported, both normal and from plugins.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MarcinW
Power Member
Power Member


Joined: 23 Jan 2012
Posts: 763
Location: Poland

PostPosted: Thu May 17, 2018 8:31 am    Post subject: Reply with quote

Partially fixed.

Try this in Time field:

24 -> neither date, not time is changed - no error information appears

24:58 -> neither date, not time is changed - no error information appears

24:58:00 -> neither date, not time is changed - no error information appears

24:59 -> interestingly, error information appears here
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35473
Location: Switzerland

PostPosted: Fri May 18, 2018 4:31 am    Post subject: Reply with quote

Quote:
24 -> neither date, not time is changed - no error information appears

NOT confirmed. It's set to 00:00 here.

Quote:
24:58 -> neither date, not time is changed - no error information appears

24:58:00 -> neither date, not time is changed - no error information appears

24:59 -> interestingly, error information appears here


Confirmed. Maybe I should forbid 24:00 and higher?
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MarcinW
Power Member
Power Member


Joined: 23 Jan 2012
Posts: 763
Location: Poland

PostPosted: Fri May 18, 2018 4:37 am    Post subject: Reply with quote

ghisler(Author) wrote:
Maybe I should forbid 24:00 and higher?

After reading https://en.wikipedia.org/wiki/24-hour_clock#Midnight_00:00_and_24:00, the answer is: Yes!


00:00 means the beginning of the day, 24:00 means end of the same day! They are not equal. So 2018-05-10 24:15 = 2018-05-11 0:15! So using 24:xx:xx notation would lead to many unintended results I think.
Back to top
View user's profile Send private message Send e-mail
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7668
Location: Valsted, Denmark

PostPosted: Fri May 18, 2018 11:40 am    Post subject: Reply with quote

Quote:
Maybe I should forbid 24:00 and higher?


I think that is the best
_________________
#524
Danish Total Commander Translator
TC 9.12 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.91b2 on Android 6.0

Get Extended Total Commander Menus
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35473
Location: Switzerland

PostPosted: Mon May 21, 2018 2:22 am    Post subject: Reply with quote

OK, I will.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35473
Location: Switzerland

PostPosted: Wed May 23, 2018 9:36 am    Post subject: Reply with quote

This should be fixed in Total Commander 9.20 beta 4, please check!
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 7668
Location: Valsted, Denmark

PostPosted: Wed May 23, 2018 8:20 pm    Post subject: Reply with quote

Confirmed that entering 24:00 or higher is no longer allowed Smile

Then comes the question about the time 23:59:59 on FAT drives - it is rounde up to 00:00:00 and the date is increased by 1 day or 22:59:59 - it is rounded up to 23:00:00.

If it is a Windows call that does the up-rounding, then I guess it is OK, otherwise maybe it would be better to round down.
_________________
#524
Danish Total Commander Translator
TC 9.12 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit. TC 2.91b2 on Android 6.0

Get Extended Total Commander Menus


Last edited by petermad on Thu May 24, 2018 4:54 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC9.2x bug reports (English) All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group