You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	This commit is contained in:
		| @@ -0,0 +1,9 @@ | ||||
| --- | ||||
| title: "Frontmatter test" | ||||
| created_at: 01-01-2024 01:23 AM | ||||
| updated_at: 02-01-2024 04:56 AM | ||||
| --- | ||||
|  | ||||
| # Frontmatter test | ||||
|  | ||||
| A test note with frontmatter. | ||||
| @@ -140,6 +140,13 @@ describe('InteropService_Importer_Md_frontmatter: importMetadata', () => { | ||||
| 		expect(note.title).toBe('Distill for R Markdown'); | ||||
| 		expect(note.author).toBe('JJ Allaire'); | ||||
| 	}); | ||||
| 	it('should import Notesnook files with created and update timestamps', async () => { | ||||
| 		const note = await importTestFile('notesnook_updated_created.md'); | ||||
|  | ||||
| 		expect(note.title).toBe('Frontmatter test'); | ||||
| 		expect(note.user_created_time).toBe(Date.parse('2024-01-01T01:23:00.000')); | ||||
| 		expect(note.user_updated_time).toBe(Date.parse('2024-01-02T04:56:00.000')); | ||||
| 	}); | ||||
| 	it('should handle date formats with timezone information', async () => { | ||||
| 		const note = await importTestFile('utc.md'); | ||||
|  | ||||
|   | ||||
| @@ -111,6 +111,9 @@ export default class InteropService_Importer_Md_frontmatter extends InteropServi | ||||
| 			metadata['user_created_time'] = time.anythingToMs(md['created'], Date.now()); | ||||
| 		} else if ('date' in md) { | ||||
| 			metadata['user_created_time'] = time.anythingToMs(md['date'], Date.now()); | ||||
| 		} else if ('created_at' in md) { | ||||
| 			// Add support for Notesnook | ||||
| 			metadata['user_created_time'] = time.anythingToMs(md['created_at'], Date.now()); | ||||
| 		} | ||||
|  | ||||
| 		if ('updated' in md) { | ||||
| @@ -120,6 +123,9 @@ export default class InteropService_Importer_Md_frontmatter extends InteropServi | ||||
| 			metadata['user_updated_time'] = time.anythingToMs(md['lastmod'], Date.now()); | ||||
| 		} else if ('date' in md) { | ||||
| 			metadata['user_updated_time'] = time.anythingToMs(md['date'], Date.now()); | ||||
| 		} else if ('updated_at' in md) { | ||||
| 			// Notesnook | ||||
| 			metadata['user_updated_time'] = time.anythingToMs(md['updated_at'], Date.now()); | ||||
| 		} | ||||
|  | ||||
| 		if ('latitude' in md) { metadata['latitude'] = md['latitude']; } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user