Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-50021

POLICY: Support for %k and %l datetime conversion specifiers

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.9
    • Fix Version/s: None
    • Component/s: Libraries
    • Labels:
    • Affected Branches:
      MOODLE_29_STABLE

      Description

      While working on MDL-49974 It was observed that %l is not supported and unit test was failing because of it.
      Also %P is supported which means lowercase in linux and uppercase in windows.
      http://php.net/manual/en/function.strftime.php
      https://msdn.microsoft.com/en-us/library/fe06s4ak.aspx

      Eloy Lafuente (stronk7) suggested,
      A) If we want to allow %k, %l and other non-zero formatters... then we'll need to hack timestamp_to_date_string() badly with hacks like the $fixday and $fixhour ones.
      B) If we don't want to allow those formatters... then IMO it would be great to ban them officially (docs required). An surely that same function can be also a good place to, with debugging enabled, perform a simple regexp looking for invalid ones and to warn about them.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              rajeshtaneja Rajesh Taneja
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: