Validating timestamps in record

[?]
Apr 29, 2021, 4:33 PM
NS36CJCO6E2FS65JRHHMOK4GTL7CLNOOLQZZAAAIZI2CQYNPAYRQC

Dependencies

  • [2] 4H2XTVJ2 Fix some mistakes in the docs
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [4] AEPEFS7O Write help for each argument
  • [5] KWAMD2KR A few fixes in the documentation comments

Change contents

  • replacement in pijul/src/commands/record.rs at line 39
    [2.863][3.102463:102495](),[3.1253][3.102463:102495](),[3.102463][3.102463:102495]()
    #[clap(long = "timestamp")]
    [2.863]
    [3.102495]
    #[clap(long = "timestamp", validator = timestamp_validator)]
  • edit in pijul/src/commands/record.rs at line 57
    [3.102760]
    [3.102760]
    fn timestamp_validator(s: &str) -> Result<(), &'static str> {
    if let Ok(t) = s.parse() {
    if chrono::NaiveDateTime::from_timestamp_opt(t, 0).is_some() {
    return Ok(())
    }
    }
    Err("Could not parse timestamp")
    }