diff options
| author | Laurenz Stampfl <47084093+LaurenzV@users.noreply.github.com> | 2023-05-23 10:41:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-23 10:41:20 +0200 |
| commit | 752817ae74607ca23ec0aad51824ddca66faa7a8 (patch) | |
| tree | d9f51f3d029c1ca8754be9ae9ccc9dc91ae6b000 /src/lib.rs | |
| parent | f4fd6855e7fb833a2125d2e81aa3b9f548b18170 (diff) | |
Add support for date & time handling (#435)
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -58,7 +58,7 @@ use comemo::{Prehashed, Track, TrackedMut}; use crate::diag::{FileResult, SourceResult}; use crate::doc::Document; -use crate::eval::{Library, Route, Tracer}; +use crate::eval::{Datetime, Library, Route, Tracer}; use crate::font::{Font, FontBook}; use crate::syntax::{Source, SourceId}; use crate::util::Buffer; @@ -116,4 +116,10 @@ pub trait World { /// Try to access a file at a path. fn file(&self, path: &Path) -> FileResult<Buffer>; + + /// Get the current date. + /// + /// If no offset is specified, the local date should be chosen. Otherwise, + /// the UTC date should be chosen with the corresponding offset in hours. + fn today(&self, offset: Option<i64>) -> Option<Datetime>; } |
