ಮಾಡ್ಯೂಲ್:Citation/CS1/Date validation/sandbox: ಪರಿಷ್ಕರಣೆಗಳ ನಡುವಿನ ವ್ಯತ್ಯಾಸ

Content deleted Content added
No edit summary
No edit summary
೪೨ ನೇ ಸಾಲು:
good2, tomorrow_ts = pcall( lang.formatDate, lang, 'U', 'today + 2 days' ); -- today midnight + 2 days is one second more than all day tomorrow
-- if forgood1 wikisand thatgood2 do not use Western digits in their language scripts becausethen -- lang.formatDate() returns a timestamp in the local script which which tonumber() doesn'tmay not understand
if good1 and good2 then
-- access_ts = tonumber (access_ts) or lang:parseFormattedNumber (access_ts); -- convert to numbers for the comparison;
-- tomorrow_ts = tonumber (tomorrow_ts) or lang:parseFormattedNumber (tomorrow_ts);
-- for wikis that do not use Western digits in their language scripts because lang.formatDate() returns a timestamp in the local script which tonumber() doesn't understand
access_ts = lang:parseFormattedNumber (access_ts); -- convert to numbers for the comparison
tomorrow_ts = lang:parseFormattedNumber (tomorrow_ts);
else
return false; -- one or both failed to convert to unix time stamp