feat(date-converter): added mongodb objectID format
This commit is contained in:
		
							parent
							
								
									7f229959d6
								
							
						
					
					
						commit
						4ef25887b9
					
				| @ -132,5 +132,10 @@ const formats: Format[] = [ | |||||||
|     fromDate: (date) => date.toUTCString(), |     fromDate: (date) => date.toUTCString(), | ||||||
|     toDate, |     toDate, | ||||||
|   }, |   }, | ||||||
|  |   { | ||||||
|  |     name: 'Mongo ObjectID', | ||||||
|  |     fromDate: (date) => Math.floor(date.getTime() / 1000).toString(16) + '0000000000000000', | ||||||
|  |     toDate: (objectId) => new Date(parseInt(objectId.substring(0, 8), 16) * 1000), | ||||||
|  |   }, | ||||||
| ]; | ]; | ||||||
| </script> | </script> | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user