Unusual behavior in Change Attributes dialog
Moderators: white, Hacker, petermad, Stefan2
Unusual behavior in Change Attributes dialog
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
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
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
2559-1-1 is just a placeholder here for an invalid date.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
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
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
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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.
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
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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.
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
https://www.ghisler.com
https://www.ghisler.com
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
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
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
NOT confirmed. It's set to 00:00 here.24 -> neither date, not time is changed - no error information appears
Confirmed. Maybe I should forbid 24:00 and higher?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
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
After reading https://en.wikipedia.org/wiki/24-hour_clock#Midnight_00:00_and_24:00, the answer is: Yes!ghisler(Author) wrote:Maybe I should forbid 24:00 and higher?
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.
I think that is the bestMaybe I should forbid 24:00 and higher?
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
This should be fixed in Total Commander 9.20 beta 4, please check!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Confirmed that entering 24:00 or higher is no longer allowed
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.
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.
Last edited by petermad on 2018-05-24, 10:54 UTC, edited 2 times in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar