facebookarchive / instant-articles-builder

Instant Articles Rules Editor
https://facebook.github.io/instant-articles-builder
Other
125 stars 67 forks source link

problem parsing localized release date #115

Open bbaronSVK opened 5 years ago

bbaronSVK commented 5 years ago

Steps required to reproduce the problem

  1. localized publishing date - 19. února 2019 ● 14:44
  2. we use strftime but not date

Expected Result

*

Actual Result

*

Environment Info

VERSION: 0.2.0 URL: https://www.blesk.cz/clanek/celebrity-ceske-celebrity/596207/zarostly-repka-u-soudu-podminky-mu-zmenili-na-9-mesicu-natvrdo.html RULES:

{
  "generator_name": "facebook-instant-articles-builder",
  "generator_version": "0.2.0",
  "rules": [
    {
      "class": "TextNodeRule"
    },
    {
      "class": "GlobalRule",
      "selector": "html",
      "properties": {
        "article.title": {
          "attribute": "content",
          "selector": "h1",
          "type": "element"
        },
        "article.publish": {
          "format": "d. F Y ● G:i",
          "selector": ".dateTime",
          "type": "date"
        },
        "author.name": {
          "selector": ".author",
          "type": "string"
        },
        "image.url": {
          "attribute": "src",
          "selector": ".gallery-main-container .gallery",
          "type": "string"
        },
        "article.body": {
          "attribute": "content",
          "selector": "#bbtext",
          "type": "element"
        },
        "article.canonical": {
          "attribute": "href",
          "selector": "link[rel=canonical]",
          "type": "string"
        }
      }
    },
    {
      "class": "BlockquoteRule",
      "selector": "blockquote"
    },
    {
      "class": "ParagraphRule",
      "selector": "p"
    },
    {
      "class": "H2Rule",
      "selector": "h2"
    },
    {
      "class": "H1Rule",
      "selector": "h1"
    },
    {
      "class": "ListElementRule",
      "selector": "ol, ul"
    },
    {
      "class": "ListItemRule",
      "selector": "li"
    },
    {
      "class": "AnchorRule",
      "selector": "a",
      "properties": {
        "anchor.href": {
          "attribute": "href",
          "selector": "a",
          "type": "string"
        }
      }
    },
    {
      "class": "ItalicRule",
      "selector": "i"
    },
    {
      "class": "EmphasizedRule",
      "selector": "em"
    },
    {
      "class": "BoldRule",
      "selector": "b, strong"
    },
    {
      "class": "ImageRule",
      "selector": "img",
      "properties": {
        "image.url": {
          "attribute": "src",
          "selector": "img",
          "type": "string"
        },
        "image.caption": {
          "attribute": "src",
          "selector": "img",
          "type": "element"
        }
      }
    }
  ]
}
pestevez commented 3 years ago

Hi @bbaronSVK - apologies for the delayed response. I see, I believe it is possible to create a localized version of the date, but I am treating it as a bug.

My recommendation would be to add an attribute to the field with the ISO date, and/or to add some of the standard meta tags for creation and modification time. This is in line with the way that we'll likely treat dates in the future. (See this comment for more details)