added: insert current date if note has tag "journal"
This commit is contained in:
		
							parent
							
								
									207cd570e8
								
							
						
					
					
						commit
						263af2a863
					
				
							
								
								
									
										12
									
								
								main.js
								
								
								
								
							
							
						
						
									
										12
									
								
								main.js
								
								
								
								
							| 
						 | 
					@ -2991,6 +2991,18 @@ function defaultheaders(tags = "")
 | 
				
			||||||
function loadnote(name)
 | 
					function loadnote(name)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	var note = getorcreate(name, defaultheaders());
 | 
						var note = getorcreate(name, defaultheaders());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (gettags(note).includes("journal"))
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							var hat = headerandtext(note);
 | 
				
			||||||
 | 
							var today = timestamp().substr(0,10);
 | 
				
			||||||
 | 
							if (!hat.text.startsWith("\n" + today))
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								note.content = hat.header + "\n" + today + "\n\n" + hat.text;
 | 
				
			||||||
 | 
								note.pos = hat.header.length + 12;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bindfile(note);
 | 
						bindfile(note);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	stat.cur.q = 0;
 | 
						stat.cur.q = 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue