mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			Fixing datetime
							parent
							
								
									d40fde1136
								
							
						
					
					
						commit
						02d80c73be
					
				| 
						 | 
				
			
			@ -21,6 +21,7 @@ from utils import delete_post
 | 
			
		|||
from utils import remove_moderation_post_from_index
 | 
			
		||||
from utils import local_actor_url
 | 
			
		||||
from utils import date_utcnow
 | 
			
		||||
from utils import date_epoch
 | 
			
		||||
from session import post_json
 | 
			
		||||
from webfinger import webfinger_handle
 | 
			
		||||
from auth import create_basic_auth_header
 | 
			
		||||
| 
						 | 
				
			
			@ -196,8 +197,9 @@ def remove_old_hashtags(base_dir: str, max_months: int) -> str:
 | 
			
		|||
            last_modified_date = \
 | 
			
		||||
                datetime.fromtimestamp(mod_time_since_epoc,
 | 
			
		||||
                                       datetime.timezone.utc)
 | 
			
		||||
            prev_date_epoch = date_epoch()
 | 
			
		||||
            file_days_since_epoch = \
 | 
			
		||||
                (last_modified_date - datetime(1970, 1, 1)).days
 | 
			
		||||
                (last_modified_date - prev_date_epoch).days
 | 
			
		||||
 | 
			
		||||
            # check of the file is too old
 | 
			
		||||
            if file_days_since_epoch < max_days_since_epoch:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,6 +13,7 @@ from utils import get_nickname_from_actor
 | 
			
		|||
from utils import get_config_param
 | 
			
		||||
from utils import escape_text
 | 
			
		||||
from utils import date_utcnow
 | 
			
		||||
from utils import date_epoch
 | 
			
		||||
from categories import get_hashtag_categories
 | 
			
		||||
from categories import get_hashtag_category
 | 
			
		||||
from webapp_utils import set_custom_background
 | 
			
		||||
| 
						 | 
				
			
			@ -69,7 +70,8 @@ def html_hash_tag_swarm(base_dir: str, actor: str, translate: {}) -> str:
 | 
			
		|||
    """
 | 
			
		||||
    max_tag_length = 42
 | 
			
		||||
    curr_time = date_utcnow()
 | 
			
		||||
    days_since_epoch = (curr_time - datetime(1970, 1, 1)).days
 | 
			
		||||
    prev_time_epoch = date_epoch()
 | 
			
		||||
    days_since_epoch = (curr_time - prev_time_epoch).days
 | 
			
		||||
    days_since_epoch_str = str(days_since_epoch) + ' '
 | 
			
		||||
    days_since_epoch_str2 = str(days_since_epoch - 1) + ' '
 | 
			
		||||
    recently = days_since_epoch - 1
 | 
			
		||||
| 
						 | 
				
			
			@ -100,7 +102,7 @@ def html_hash_tag_swarm(base_dir: str, actor: str, translate: {}) -> str:
 | 
			
		|||
                datetime.fromtimestamp(mod_time_since_epoc,
 | 
			
		||||
                                       datetime.timezone.utc)
 | 
			
		||||
            file_days_since_epoch = \
 | 
			
		||||
                (last_modified_date - datetime(1970, 1, 1)).days
 | 
			
		||||
                (last_modified_date - prev_time_epoch).days
 | 
			
		||||
 | 
			
		||||
            # check if the file was last modified within the previous
 | 
			
		||||
            # two days
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue