lubridate icon indicating copy to clipboard operation
lubridate copied to clipboard

Stamp fails on a basic input

Open vspinu opened this issue 6 years ago • 1 comments

library(lubridate, warn.conflicts = FALSE)

stamp("february  14, 2004")(ymd_hms("2012-08-13 11:37:53"))
#> Multiple formats matched: "%Om  %d, %y%H"(1), "%Om  %y, %d%H"(1), "february  %y, %d%Om"(1), "%Om  %d, %Y"(1), "february  %d, %y%Om"(1), "%B  %d, %y%H"(1), "%B  %y, %d%H"(1), "february  %y, %d%m"(1), "%B  %d, %Y"(1), "february  %d, %y%m"(1), "february  %H, %M%S"(1)
#> Using: "%B  %y, %d%H"
#> [1] "August  12, 1311"

Created on 2019-11-19 by the reprex package (v0.3.0)

vspinu avatar Jan 31 '18 22:01 vspinu

I was able to reproduce the bug using lubridate_1.7.4.

> library(lubridate)
> 
> x <- today()
> myDateStamp <- stamp("My date is Saturday, July 27, 2019.")
Multiple formats matched: "My date is %A, %B %d, %y%H."(1), "My date is %A, %B %y, %d%H."(1), "My date is %A, %B %d, %Y."(1), "My date is Saturday, %Om %d, %y%H."(1), "My date is Saturday, %Om %y, %d%H."(1), "My date is Saturday, %Om %d, %Y."(1), "My date is Saturday, %B %d, %y%H."(1), "My date is Saturday, %B %y, %d%H."(1), "My date is Saturday, %B %d, %Y."(1), "My date is %A, %Om %d, %y%H."(0), "My date is %A, %Om %y, %d%H."(0), "My date is %A, %Om %d, %Y."(0)
Using: "My date is %A, %B %y, %d%H."
> 
> myDateStamp(x)
[1] "My date is Saturday, July 19, 2700."

My session info:

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] lubridate_1.7.4

loaded via a namespace (and not attached):
[1] compiler_3.6.1 magrittr_1.5   tools_3.6.1    Rcpp_1.0.2     stringi_1.4.3  stringr_1.4.0 

crossxwill avatar Jul 28 '19 00:07 crossxwill